The instance retention graph shows chains of references between GC roots and your selected object.
Start at your selected object and follow the chains of references up towards the GC roots, to identify references that are preventing the garbage collector from collecting your object.
When you find a reference that shouldn't be there, modify your code to break the reference, and then profile the application again to check the problem is fixed.
The instance you selected. | |
GC root object. | |
The object under this one in the graph is a GC root because it is a GC Handle. | |
The object under this one in the graph is a GC root because it is on the stack, having been put on the stack by | |
The object under this one in the graph is a GC root because it is a member of the static variable | |
Group of strongly-connected objects | |
Non-disposable instance for which you have source code. | |
Non-disposable instance for which you do not have source code. | |
Disposable instance for which you have source code. | |
Disposable instance for which you do not have source code. | |
Disposed instance. | |
The simplest path between these two instances. |
Move your mouse pointer over an object to view more information in a tooltip.
Click on a node in the graph to see the properties of a specific instance.
You can't see the properties of an instance if you selected Make snapshots faster by leaving out object values when setting up the profiling session, or if the snapshot was bigger than 4GB. |
After you have modified your code to break the first chain of references, profile your application again; the instance retention graph updates to show the chain of references which is now the shortest chain. You will need to modify your code again, to break this chain of references, and repeat until all the chains of references are broken and the object is no longer in memory.
However, the relationship between strongly connected objects is complex, so in this case you may need to break more than one reference to prevent your object from being held in memory. Break the references one at a time, and take new snapshots each time to check whether your object is still in memory.