How Xrunhprof works
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!