Turn from HTTP://WWW.CNBLOGS.COM/NB44C/P/5218880.HTML1. Install the mat plugin first
Memory Analyzer Plugin: http://www.eclipse.org/mat/downloads.php
Click to download
3. Extract the downloaded files to the MyEclipse Dropins folder
4. Create a. link file with the same name as the folder, and write the corresponding address in the file (address using \ \ or/)
5. Restart MyEclipse to see the Memory Analyzer option in window---->preferances.
2. Analyze instances using the Mat tool
1. Create test Java code
-verbose:gc-xms20m-xmx20m
-xx:+heapdumponoutofmemoryerror
* @author y * */public class Test { static class oomobject{ } public static void Main (string[] args) { Lis t<oomobject> list = new arraylist<oomobject> (); while (true) { list.add (new Oomobject ());}}}
2. Set the operating parameters
Parameter explanation:
1, the heap is a storage object instance, that is, the class is written in the heap memory allocation; Set the size of the heap:-xmx20m ( maximum),-xms20m(minimum).
2, the stack is to store local variables, operations stack, dynamic link, method exit (all in the stack frame), when the method is called, the stack frame is created; Sets the size of the stack:-xss128k.
3, the method area is the information that holds class, such as Class name, access modifier, constant pool, field description, method description, and so on. In addition, the run-time constant pool belongs to the method area, that is, storing constants, static constants, etc., set the method area size,-xx:permsize=10m, and-xx:maxpermsize=10m.
4, local direct memory ; set local direct memory size:-xx:maxdirectmemorysize(the default is the same as the value of-XMX).
3. Run the program, the following information will appear
Analysis: Refer to the blog
http://www.ibm.com/developerworks/cn/opensource/os-cn-ecl-ma/index.html?ca=drs-
http://essen.iteye.com/blog/1825314
http://tivan.iteye.com/blog/1487855
Ext: MyEclipse Install the Eclipse Memory Analyzer plugin and perform the error file analysis process