Java heap dump example 2017-06-30 05:38

We use jmap command to dump the Java heap. Examples are here.

dump all objects in heap

jmap -dump:format=b,file=/tmp/dump_file.hprof <pid> 

dump live objects in heap

If you want only dump live objects, use following command.

jmap -dump:live,format=b,file=/tmp/dump_file.hprof <pid>

EOF