Skip to content

Instantly share code, notes, and snippets.

@alexandrnikitin
Last active July 4, 2019 09:54
Show Gist options
  • Save alexandrnikitin/f3f5a5fe360aead13b48bddd1f024b24 to your computer and use it in GitHub Desktop.
Save alexandrnikitin/f3f5a5fe360aead13b48bddd1f024b24 to your computer and use it in GitHub Desktop.
JVM Large heap analysis
// install Eclipse Memory Analyzer (MAT)
wget http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/mat/1.6.1/rcp/MemoryAnalyzer-1.6.1.20161125-linux.gtk.x86_64.zip
unzip MemoryAnalyzer-1.6.1.20161125-linux.gtk.x86_64.zip
cd mat/
// add more heap to mat
nano MemoryAnalyzer.ini
// create a dump
su - username // if needed
ps aux | grep java
/opt/jdk1.8.0_131/bin/jmap -dump:live,format=b,file=/tmp/22219javaheap.hrpof 22219
./ParseHeapDump.sh /tmp/22219javaheap.hrpof // creates indexes
./ParseHeapDump.sh /tmp/22219javaheap.hrpof org.eclipse.mat.api:suspects // creates a report
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment