Search code examples
javaheap-dumpjmap

JMap dump format specification


Are there any open specifications for jmap heap dump format?

Thanks for help!


Solution

  • If you need an histogram of the heap, you can use jmap -histo <pid> to get the histogram from your live JVM. If you already have the heap dump file, with Eclipse MAT (Eclipse Memory Analyzer Tool) you can load the dump and easily get the histogram you are looking for.

    Maybe Lars Vogel tiny tutorial on it can be an easy first step.

    Regarding the hprof binary format, I bookmarked this some time ago: http://java.net/downloads/heap-snapshot/hprof-binary-format.html, but developing your own parser to get an histogram is totaly overkill.