Monday, January 12, 2015

Analyzing large heap dumps

When the heap size is so large such as over 20GB then it is very difficult to analyze the dump. The best solution is use the Eclipse Memory Analyzer.

1. Install the the Memory analyzer in the linux server which has sufficient memory.

2. Increase the memory by editing the MemoryAnalyzer.ini ( -Xmx25g )

3. Give executing permission to ParseHeapDump.sh file
    chomod 755 ParseHeapDump.sh

4. Take the heap dump as binary.
    jmap -dump:format=b,file=<file-path>.bin <pid>

5. zip the dump file and transfer to the server that you want.

    tar -czvf example.tgz example
    tar -xzvf example.tgz

6. Execute the follwing command which genrate the index files

   ./ParseHeapDump.sh ../20150112_PRODAPP5/20150112jmap.bin

7. Generate the reports

    ./ParseHeapDump.sh ../20150112_PRODAPP5/20150112jmap.bin org.eclipse.mat.api:suspects
    ./ParseHeapDump.sh ../20150112_PRODAPP5/20150112jmap.bin org.eclipse.mat.api:overview

8. Download the zip files.

Now you have suspects report and overview.

No comments:

Post a Comment