Code Monkey home page Code Monkey logo

hprof-parser's Introduction

Hprof Heap Dump parser
Eddie Aftandilian ([email protected])

This is the source code for a parser for Hprof heap dump files that can
be produced by various JVMs.  This code parses the binary format of these
files.  Documentation on the file format and the meanings of the different
record types can be found here:
http://blogs.sun.com/kto/resource/manual.html (older documentation)
$JVM/demo/jvmti/hprof/src/manual.html (if you have the Sun JDK installed)

The main functionality is in the HprofParser.java file, which parses the heap 
dump file and calls a method in the associated RecordHandler for each record 
parsed.  The RecordHandler interface is meant to be implemented to perform 
whatever analysis you like.  I recommend subclassing NullRecordHandler, which
does nothing for all records, and overriding only the methods for the record
types you are interested in.  By default, the Parse program uses the example
PrintHandler, which simply prints the data from each record.  To change to a 
different handler class, simply pass the command line option
"--handler=<classname>" to Parse, where classname is the fully-qualified
class name of the handler class.

I provide a sample heap dump from Dacapo antlr in the file java.hprof.

The build uses Maven (http://maven.apache.org/).  You can build it with the
following command:
$ maven compile

To produce a binary heap dump from the Oracle JVM, use the following command:
java -agentlib:hprof=heap=dump,format=b ToBeProfiledClass

This will dump the heap at the end of program execution.  See the 
documentation referenced above to see how to produce heap dumps at other 
points in program execution.

This code is released under the Apache 2.0 license.  See the LICENSE file in
this directory for details.

hprof-parser's People

Contributors

bogdad avatar eaftan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.