$ jmap -dump:format=b,file=/var/tmp/dump.hprof 1234
July 8, 2013, 8:18 a.m.
—
Janos
Explanation
- Create a heap dump from the running Java process with PID=1234
- The heap dump will be saved in
/var/tmp/dump.hprof
in binary format
- You can open the dump with "MAT", the Memory Analyzer Tool (based on Eclipse) and identify objects that use most of the memory and potential memory leaks
For more options see jmap -h