Different Ways to Capture Java Heap Dumps

In this tutorial, I am going to discuss what is java heap dump and what are the different ways to capture a java heap dumps.

What is a Heap Dump?

A heap dump is the snapshot of all the objects in the JVM at a certain moment. In simple words, It is the snapshot of the java memory.

The heap dump is useful in debugging java memory-leak issue and out-of-memory error in java applications. Heap dump is capture/store in binary format (hprof) files.

Once heap dump is taken it can be analyzed through heap analyzer tools such as Eclipse memory analyzer tool (MAT), JVisualVM, HeapHero etc. In this tutorial, i am only going to discuss how to generate java heap dumps.