The dominator tree view
The dominator tree view shows the largest objects in the heap dump. The second level of the tree lists the objects that would be removed by the garbage collector if all incoming references to the parent node were removed.
Use the dominator tree view to identify the largest areas of retained memory, and the dependencies between objects. You can use the dominator tree view to investigate which objects are keeping other objects alive. You can group the tree by class loader or packages, to help with the analysis.
- Dominator
- An object is described as dominating another object if every path in the object graph from the root, or start, must go through that object. For example, object x dominates object y if all routes to object y must go through object x.
- Immediate dominator
- An object is described as an immediate dominator if it is the dominator that is closest to a target object.
- Dominator tree
- This view is built from the object graph. In the dominator tree view, each object is the immediate dominator of its children, so dependencies between the objects are easily identified.
- The root of the tree shows the dominating object, and objects that belong to the subtree represent the retained set.
- If x is the immediate dominator of y, then the immediate dominator of x also dominates y, and so on.
- The edges in the dominator tree do not directly correspond to object references from the object graph.
The following diagram shows the transformation of the object reference graph into the dominator tree view. In this example, object C is the immediate dominator of objects D, E, and F. The retained set of object C consists of objects D, E, F, G, and H.
