.NET Memory Profiler Instance Graph
The instance graph gives you a visual overview of how a managed instance is being used, how it is related to other instances, and, maybe most importantly, how roots are preventing it from being garbage collected.
The graph can include all instances that are related to the selected instance. This includes instances and roots that can reach the selected instance, and instances that are reachable from the selected instance. By default, only root path instances and held instances are included in the graph, i.e. the instances and roots that are preventing the selected instance from being garbage collected and the instances that are uniquely reachable from the selected instance. To select which instances to include in the graph, use the Include menu ( ).
New! Combined instances graph
The graph under the Type/Filter details view shows the root paths of the selected instances, the instances with a specific shortest root path, or the instances that share a common allocation call stack.
Investigating root paths in a large graph
If the instance graph is large, it can be hard to locate specific root paths. In this case the Align root path command is useful. This command is available from the popup window of each instance, root, and reference in the graph, as well as from the right click menu. When selected, it will find the shortest root path that passes through the instance, root, or reference, highlight the root path and group all instances. Root paths can also be selected using the navigation buttons that are provided on the sides of the graph. For more information watch the root path navigation demo.
Updated! Large instance graph reduction
An instance graph can easily become much larger than can be conveniently presented visually. To avoid presenting too large graphs, .NET Memory Profiler will reduce the graph by combining groups of instances and roots into single graph nodes. The profiler tries to select groups so that the overall structure of the graph is affected as little as possible.
Combined instances can be expanded by using the Expand command that is available in the popup window and right-click menu of the combined instances and combined references. The expand options depend on how the instances and references have been combined. Typically they include options for expanding a specific type, a field, or just a number of instances. For more information see the demo.