twilight ventures

open a .hprof heap dump in a JetBrains IDE

To open a .hprof heap dump in IntelliJ IDEA, install our Heap Dump Lens plugin and double click the file. In the IDE, go to Settings, then Plugins, search the Marketplace tab for Heap Dump Lens and install it; the IDE asks for one restart. After that, double clicking a .hprof file in the Project tool window opens it in an editor tab, and the class histogram is the first thing on screen. Reading a dump this way is free, and it needs no paid edition of the IDE.

questions

Does it work in IntelliJ IDEA Community Edition?

Yes. Heap Dump Lens installs into every JetBrains IDE from version 2024.2, Community editions included. PyCharm, GoLand and the other JetBrains IDEs open a dump the same way.

Can it open a dump bigger than the memory the IDE has?

Yes. The index goes to a work directory on disk, so what stays in memory depends on how many classes and strings the dump has, not on its object count. Our own 2.6 GB dump of twenty million objects indexes in about 12.5 seconds inside a 512 MB cap. A dump past the IDE's large file limit opens the same way.

Does the dump leave my machine?

No. The plugin reads the file where it is, never rewrites it and makes no network calls, and the Pro license is handled by the IDE's own JetBrains licensing.

one incident, file by file

A container is killed for memory overnight and leaves a .hprof file behind. It is a few gigabytes of objects on a laptop, and the class that filled the heap is somewhere inside it.

opening

The tab is Heap Dump Lens, for a .hprof file and for a file whose name says nothing, since what the reader looks at is the hprof bytes at the head of the file. Gzipped dumps are opened as they came: the .hprof.gz is inflated into a work directory, with progress, and the copy is deleted with the tab.

Often the process was killed before the JVM finished writing, and what reaches you is a partial dump. The tab reports that file as truncated and names the byte it ends at and the record it ends in, so the state of the file is legible at the top of the tab.

Heap Dump Lens in IntelliJ IDEA: the class histogram of a 2.6 GB dump sorted by bytes
service-heap.hprof: 2.6 GB, 20,030,919 objects and 725 classes, the histogram sorted by bytes, the Retained tab beside it.

what comes up

The class histogram comes up first. One row per class under its real name, its instance count, and the shallow bytes those instances hold. Either column sorts and the filter takes a class name. Beside the histogram are the dump's facts: object count, loaded classes, GC roots, format and id width, total heap bytes.

the thread dump and the GC log

The same incident usually leaves two more files beside the dump. A .tdump file opens parsed, each thread under its state with its daemon flag and its frames, and saved jstack output that carries no such extension comes in through Tools, Open Thread Dump (Heap Dump Lens). Unified -Xlog:gc* output has an entry of its own in the same menu, Open GC Log (Heap Dump Lens), and arrives as a table of pause events with the heap before and after each pause, its duration, the longest of them and the total.

free, and what Pro adds

All of the above is free, and the free tier does not expire. Pro computes the dominator tree across the whole object graph, so the Retained tab can rank the top 500 retainers by what each one would free, retained and shallow bytes side by side. On that same 2.6 GB dump it pulled thirty million references and finished the dominators in under half a minute. Pro also writes the histogram, a filter's matches or the retainer ranking out to CSV, while the histogram on screen and copying rows out of it stay free. Pro is a subscription with a 30-day trial, priced on the product page.

where it stops

The plugin does not attach to a running process, and a flight recording is a different kind of file that it leaves alone. A file that is no heap dump at all names the reason it is not one, with no stack trace to decipher. Thread dump parsing follows HotSpot output, and a GC line the parser does not recognize stays out of the totals. It produces no leak verdict of its own, so the dominator ranking is what you work from.