Search code examples
javaheap-dump

Programmatically analyze java heap dump file


I want to write a program (preferably in java) that will parse and analyze a java heap dump file (created by jmap). I know there are many great tools that already do so (jhat, eclipse's MAT, and so on), but I want to analyze the heap from a specific perspective to my application.

Where can I read about the structure of the heap dump file, examples how to read it, and so on? Didn't find anything useful searching for it...

Many thanks.


Solution

  • I'm not familiar with jhat, but Eclipse's MAT is open source. Their SVN link is available, perhaps you could look through that for their parser, perhaps even use it.