Skip to main content

How Xrunhprof works

2 replies [Last post]


I am invoking the following on a 1.4.2 VM:

java -Xrunhprof myapp

A few questions:

1) How is the heap dump actually produced? Does some sort of tracing algorithm run - traversing from the roots, via each reference until it touches every 'live' object and then dumps them all out?

2) How is the information about which stack trace produced each object stored in the VM? Is it stored against the object or in a look-up table?

3) In the SITES output at the bottom of the hprof output, does the 'number allocated' equal the total number allocated since the program began or since the last major/minor garbage collection?

4) Should the 'number of live objects' value in SITES correspond to the number of objects found with that trace number in the heap dump?

Many thanks for your help!


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-19


Don't know if this helps, but do you know this




Hi Anders,

Thanks for that. Yeah, I have seen the new Netbeans profiler. Unfortunately, I don't have a copy of the source code for the application and environmental constraints mean that I am only able to run Xrunhprof.