Memory Analyzer Reports contain various sections such as Overview, Class Histogram, Threads, Duplicate Classes, GC Roots, Unreachable Objects, System Properties, OQL… In this post let’s learn about the Dominator Tree section. What information is present in the Dominator Tree? What patterns should you look for in a Dominator Tree? What actions can you take directly from Dominators Tree view? and more importantly How to use Dominator Tree to troubleshoot Memory problems?
What is a Dominator Tree?
The Dominator Tree is a valuable tool for identifying memory leaks and diagnosing OutOfMemoryError. It highlights the largest objects in memory, the amount of memory they retain, and the raw application data held within them. Most importantly, it reveals the object reference chain that keeps the objects alive. By following this reference chain, you can pinpoint what’s preventing an object from being garbage collected and take corrective action.

Fig: Dominator Tree (aka Largest Objects) Reported by HeapHero
Dominator Tree (also known as Largest Objects) contains the following information:
1. Class Name: Fully qualified class name of the object that is present in the memory. Example: com.buggyapp.memoryleakthread.MapManager
2. Shallow Size: Memory occupied by the object itself. It does not include the memory consumed by the referenced objects. Example: 8 B
3. Retained Size: The total memory that would be freed if this object is removed. This includes the object’s shallow size and the size of all objects it exclusively retains. Example: 469.62MB
4. Percent: Percentage of the overall heap occupied by this object’s retained size.
5. Attributes: Displays all the member variables of the object and their current values.
6. Statics: Lists all static variables of the object’s class along with their values.
7. Value: The toString() output of the object, giving a textual representation of its contents.
8. Overview: A summary of key metadata: object ID, class name, shallow size, retained size, GC root status & more
Key Features of the Dominator Tree
The Dominator Tree helps you pinpoint memory leaks, identify bloated objects, and understand what’s holding them in memory. It combines deep heap insights with an intuitive interface to make memory analysis faster and more actionable. Below are the key features provided in the memory analyzer tool HeapHero’s Dominator Tree.

Fig: Dominator Tree Features in HeapHero Tool
1. Search: You can use this feature to search the objects by their name. The search feature comes handy especially when you are trying to search your application objects. Say all your application classes start with ‘com.myapp…’ package, then you can search by ‘myapp’ to see all the top memory consuming objects of your application.
2. Chart View: By default, Dominator Tree is displayed in the table format. However you can switch to an interactive pie chart view as shown in the below figure. This visual mode might make it easier to grasp memory distribution across objects. You can learn more about this visualization from the post: World’s First Interactive Graph to Visualize Objects in Memory.

Fig: Dominator Tree in interactive pie chart view
3. Sorting: Each column in the Dominator Tree: Class Name, Shallow Size, Retained Size, Percentage can be sorted. By default, objects are sorted by Retained Size and presented, so you can immediately see the biggest memory holders. However you can re-sort any column to fit your investigation needs.
4. Incoming References: To understand what is keeping an object alive in memory, you need to use this feature. ‘Incoming References’ feature basically provides you the object graph which shows the reference chain from the top-level object (i.e. GC Root) to the current object, highlighting every intermediate object along the path.
5. Outgoing References: To explore what the object is holding on to, you need to use ‘Outgoing References’. This feature visualizes the object graph from the current object down to its children. It helps answer questions like: Why is this object so large? What data is bloating it?
Note: Incoming References and Outgoing References are two of the most critical features in the Dominator Tree for diagnosing memory issues. You can learn more about them in this post: Understanding Incoming and Outgoing References in Memory Analysis
6. Actual Data: This feature lets you inspect the object’s internals including all member variables, static variables, and their current values. it will facilitate you to understand what real data is being held in memory.
7. Group By: You can re-organize the Dominator Tree using different grouping strategies to explore memory usage from different angles:
- Object (default)
- Class
- Class Loader
- Package
This feature is helpful for exploration, though not always essential for analysis.
Conclusion
Dominator Tree is your most powerful ally when it comes to identifying memory leaks or getting to the root of an OutOfMemoryError. It doesn’t just show which objects consume the most memory, it reveals why they are still in memory and what’s holding them back from being collected. By using features like incoming/outgoing references, retained size, and class-level grouping, you can zero in on memory hogs and take focused, effective action.
Hopefully, the insights shared in this post help you use the Dominator Tree with more confidence and clarity when tackling memory issues in your application.
