Skip to content

Instantly share code, notes, and snippets.

@sathish-io
Created May 6, 2014 08:29
Show Gist options
  • Save sathish-io/fa3c5fda66db1879dbc1 to your computer and use it in GitHub Desktop.
Save sathish-io/fa3c5fda66db1879dbc1 to your computer and use it in GitHub Desktop.
Taking heap dump in JVM
To troubleshoot memory leak related issues in java based application, we are in need of analyzing the JVM heap dump to understand potential objects that are causing the problem.
To take the heap dump below command helps,
jmap -dump:format=b,file=jvm_heap_dump.hprof {PID}
This will create file with name - jvm_heap_dump.hprof
Then, we can use eclipse Memory Analyzer(MAT) to analyze the dump.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment