/hprof-parser

Primary LanguageGoApache License 2.0Apache-2.0

HProf file parser

  • GoDoc for the parser.
  • GoDoc for the data structures.

This is a Go library for parsing Java Virtual Machine heap dump files (.hprof).

Not an official Google product (i.e. a 20% project).

About this library

Modern Java applications use lots of memory. The size of the heap dumps became so big that the existing analyzers such as jhat or Eclipse Memory Analyzer cannot handle them because of OutOrMemoryError.

This library provides a parser for the JVM heap dump files. You can write your own heap dump analyzer that fits your needs. Since this is just a parser, it doesn't have to hold the entire dump on memory. You can just extract necessary data for analysis.

This is written by a single person in a day, and it can parse only enough to handle heap dump files that the author had. It doesn't support all record types that hprof files can have. Send us a patch if need those unimplemented parts.

About HProf files

The library was written based on OpenJDK's heapDumper.cpp. The data structure is a straight-forward dump of JVM's internal structure. See the comments in hprofdata/hprofdata.proto.