Short answer
A heap dump is a snapshot of every object on the heap at a point in time — classes, fields, references, and retained sizes — typically written as an .hprof file.
Explanation
You analyze it to diagnose memory leaks and OutOfMemoryErrors: what is consuming memory and, via the dominator tree and reference chains, what is keeping it alive. Capture it with jmap -dump, jcmd GC.heap_dump, or automatically with -XX:+HeapDumpOnOutOfMemoryError, then open it in Eclipse MAT or VisualVM. It is a heavyweight, stop-the-world operation, so take it deliberately.
Common mistakes
- Taking heap dumps on a live service without considering the pause.
- Not knowing Eclipse MAT or dominator trees.