Tools for parsing large heap dumps

364 views
Skip to first unread message

Marshall Pierce

unread,
Jan 12, 2021, 8:23:12 AM1/12/21
to mechanical-sympathy
I've written an hprof parsing library and tools [1] that others might find useful. I had a hefty heap dump to analyze that choked every available tool I found, so the example tools in that repo mmap their input and build on-disk data structures to keep memory usage low.

I have a few questions for the experts:

- Does the style of visualization done by the `ref-count-graph` tool have a name? tl;dr - instead of showing an object graph, it shows how many times a particular field in a class referred to another concrete type with weighted edges. This effectively compresses the graph down to something a human could feasibly look at, and the weighted edges quickly draw the eye to the dominant reference chains that are keeping instances of a given type alive.

- In the JDK's class that implements hprof serialization [2], there are a number of record types that are documented, have constants for their magic bytes, etc but don't seem to ever be used, like HPROF_ALLOC_SITES or HPROF_START_THREAD. Are these vestigial remnants of past profilers, or am I just not looking hard enough?

Anyway, the tools solved my problem, and if you have similarly hefty heap dumps, maybe they can solve yours. I'd be curious to know your experiences if you end up using them or writing your own tools on top of the library.

Cheers,
Marshall

[1] https://bitbucket.org/marshallpierce/jvm-hprof-rs/src/master/
[2] https://github.com/openjdk/jdk/blob/08822b4e0526fe001c39fe08e241b849eddf481d/src/hotspot/share/services/heapDumper.cpp#L180
Reply all
Reply to author
Forward
0 new messages