Java FAQ: Top Questions
67. What is the Heap Dump and how is it analyzed?
A heap dump is a snapshot of the JVM’s heap memory, capturing all objects, classes, and references, used to diagnose memory leaks or high memory usage.
-
Generation:
Via
jmap
,-XX:+HeapDumpOnOutOfMemoryError
, or VisualVM. - Format: Typically HPROF binary format.
- Analysis: Tools like Eclipse MAT, JVisualVM, or YourKit identify dominator trees, leak suspects.
- Use Case: Finding memory leaks or optimizing memory usage.