A heap dump captures the managed runtime heap’s objects and memory state at a particular moment. It becomes especially valuable when a Java process fails so severely that ordinary debugging cannot rely on a responsive JVM. section 7.1.4
Use a heap dump as one part of post-mortem and exploratory diagnosis:
- Capture it around failures such as OutOfMemoryException when logs and stack traces do not reveal the root cause. section 7.1.4
- Compare memory evidence with garbage-collection logs, thread dumps, monitoring metrics, and normal resource baselines. section 10.3.2
- Treat it as diagnostic evidence rather than in-process recovery; fatal failures generally call for code fixes, infrastructure correction, or fail-fast behavior. section 7.1.4
Production memory failure
A production Java service throws OutOfMemoryException and becomes unsuitable for ordinary debug-mode investigation. A heap dump preserves the memory state at failure; investigators then compare it with garbage-collection behavior, thread activity, logs, and resource metrics to narrow the root cause. section 7.1.4 section 10.3.2

