Date Posted: October 23, 2003
Update: November 30, 2005 A formal PHD release that should open all variants of the PHD file format up to and including IBM 1.4.2 SR3.
What is HeapRoots?
HeapRoots is a tool for debugging memory leaks in Java™ applications through analysis of "heap dumps."
The Java Virtual Machine (JVM) maintains a run-time data area (called a heap) for the allocation of all class instances and array objects. The heap storage for objects is automatically reclaimed by a storage management system known as the garbage collector. If an application requires more heap space than can be made available by the garbage collector, the JVM throws an OutOfMemoryError.
HeapRoots analyses "heap dumps," which are files (typically text files) containing information about the objects in the JVM garbage collected heap. Some IBM VMs (contained in the IBM Developer Kits for Windows®, Java Edition) have the ability to produce heap dumps on demand; heap dumps can also be triggered by out-of-memory situations.
How does it work?
HeapRoots loads these heap dump files and provides commands for analyzing the data. These commands run algorithms on the data or query for information about the data. HeapRoots provides a command-line interactive interface where one enters commands and gets results. Examples of analysis include the following:
- searching/filtering of individual objects
- summary/tabulation of the various types of objects
- statistics on heap address space (such as gaps between objects)
- inward and outward references of an object
- paths between two objects
- exploring the heap from source/root objects by following references
- calculation of objects reachable by an object
- calculation of objects kept alive by an object.
About the technology author(s)

David Screen, a graduate in mathematics and computation, joined the service team of IBM's Java Technology Centre in December 2001. He currently works on the Process Automation (Build) team. He develops HeapRoots in his spare time because Java programming is fun and HeapRoots presents some tricky problems to solve.
