

Note that this option is verified to work on Oracle Hotspot JVM only.Įclipse MAT can be downloaded as a standalone client from

Further you can configure the Application server to automatically perform a heap dump when an ‘out of memory’ error is encountered (XX:-HeapDumpOnOutOfMemoryError).

You can also use the command ‘jmap’ to create heap dump. Earlier you saw visualvm can create a heap dump for you through the visualvm interface. For example, if you are running IBM WebSphere, you could use a wsadmin script to invoke heap dump. Now, this varies from application to application. And how do you analyze the heap dump? By using the all-powerful Eclipse Memory Analyzer (MAT)īefore we begin using MAT, how do you capture heap dump? How do you get an insight into what is in the Heap? By analyzing a Heap dump. Mind you this can run into hundreds of millions in numbers. We are literally talking about all those java objects that are in the heap. On Mac OS X, this can be done by editing MemoryAnalyzer.app/Contents/MacOS/MemoryAnalyzer.ini and increasing the value “-Xmx1024m” until it’s high enough to open the file.In your Application support/Developer Journey, you will definitely come across a time where you will want to really dive into the Java heap and see what is filling up the memory. If so, you will need to increase the memory allocated to MAT. When you attempt to open it you may see something like “An internal error occurred during: “Parsing heap dump from ‘/tmp/heapdumps/gf.’”. usr/java7/bin/jmap -dump:format=b,file=gf. /usr/java7/bin/java gf.core.13849Ī file of this size may not “just work” in MAT. Please note that this operation took almost 90 minutes: Using gf.core.13849 as example of the original 33 GB file, here is how you could convert it into a 26 GB gf. file. If the heap dump provided to you was created with gcore (such as with gcore -o /tmp/gf.core $glassfish_pid) rather than jmap, you will need to convert the file before you can open it in MAT. The Memory Analyzer Tool (MAT) from Eclipse can help you analyze heap dumps, showing you “leak suspects” such as seen at
