OpenJDK Terminology

Heap Dump

July 03, 2026

A heap dump is a snapshot of all the objects in a Java process's heap memory at a specific point in time, written to a file. It captures every object, its class, its size, and the references connecting objects to each other.

Heap dumps are an essential tool for diagnosing memory-related problems. If your application is running out of memory, growing slowly over time (a memory leak), or consuming far more RAM than expected, a heap dump lets you see exactly what is occupying the heap and trace why objects are being retained.

Common ways to capture a heap dump include the jmap command-line tool, the -XX:+HeapDumpOnOutOfMemoryError JVM flag (which writes a dump automatically when the application crashes with an OutOfMemoryError), and JDK Mission Control. The resulting file — usually with a .hprof extension — can be analysed with tools such as Eclipse MAT (Memory Analyzer Tool) or VisualVM.

A heap dump is closely related to a thread dump, but while a thread dump captures the state of running threads, a heap dump captures the state of memory.

Comments (0)

Your email address will not be published. Required fields are marked *

Highlight your code snippets using [code lang="language name"] shortcode. Just insert your code between opening and closing tag: [code lang="java"] code [/code]. Or specify another language.

Save my name, email, and website in this browser for the next time I comment.

Comments (0)

Highlight your code snippets using [code lang="language name"] shortcode. Just insert your code between opening and closing tag: [code lang="java"] code [/code]. Or specify another language.

No comments yet. Be the first.

Subscribe to foojay updates:

https://foojay.io/feed/
Copied to the clipboard