The Largest Memory Retainers view shows the objects with largest retention sizes.
These objects are shown as dominator trees.
Largest Memory Retainers view
Dominator roots are listed in the Largest Memory Retainers view. The children of each node are
the objects for which it is the immediate dominator.
When you click the Root Paths icon in the ribbon, the
Paths To GC Roots view of the currently selected object will be opened in a new tab.
There you can investigate the exact paths of references which are holding it in memory.
The Top 50 Retainers toggle button is used to
limit the number of displayed top level objects as well as the number of children shown under each object to 50.
The following information is listed for each object:
- Object ID - unique ID of the object.
- Class Name - fully qualified name of its type.
- Retained Size - total memory allocated for all dominated objects in the
subtree, including its own size.
- Own Size - memory allocated for the object.
Dominator terms and properties
A dominator of a given object A is another object B that is present in all paths in the object
reference graph that lead from a GC root to A.
An immediate dominator of a given object A is the nearest of all of A's dominators.
A dominator root is an object which doesn't have dominators.
The dominators have a very important property. If an object A is a dominator of another object B and A becomes eligible for GC,
then B will also become eligible for GC. I.e. A retains B (and all other objects in it's dominator subtree).
By examining the dominator tree one can easily identify which objects keep other objects alive and which objects retain the most memory.
For example the following object reference graph translates to these dominator trees if objects A and F are the GC roots:
Sample reference graph and its dominator trees