This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes How to read hprof in binary format? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "How to read hprof in binary format?" Watch "How to read hprof in binary format?" New topic

How to read hprof in binary format?

Gurumurthy Ramamurthy
Ranch Hand

Joined: Feb 13, 2003
Posts: 273
Hi Guys,

I am into developing a own Heap Analysis tool. For this, the input would be an (Heap Profiling) .hprof file in binary format.

But when I open this .hprof file, it contains the binary information.

Actually, I would like to know what Java APIs should I use to read and interpret (in a GUI to be created later) such binary files?

Carey Evans
Ranch Hand

Joined: May 27, 2008
Posts: 225

The HAT and VisualVM tools from Sun both parse HPROF files, and the source code is available for both of them. jhat can be found in tools.jar in Sun JDKs. If the license is acceptable to you, you could use either one of them in your project and save some work. See:
  • Old HAT website
  • Current jhat source
  • VisualVM home page
    I agree. Here's the link:
    subject: How to read hprof in binary format?
    It's not a secret anymore!