ANTS Memory Profiler - 7.1
Instance Retention Graph - ANTS Memory Profiler
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 an unexpected reference, modify your code to break the reference, and then profile the application again to check the problem is fixed.

Key
|
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.

Tips
- The instance retention graph only shows the shortest chain of references from each GC root to your selected object. When you break this chain of references, the object may still be kept in memory by a longer chain of references.
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.
- Objects grouped in a box are strongly connected; every object references every other object in the group (the reference may be direct or indirect). To remove an object from memory, you do not normally need to break all the references between a GC root and your object: only one of the references needs to be removed to prevent your object from being kept 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.
- If there is an event handler in the chain of references from a GC root to your object, look at the objects that directly reference the event handler; these references are often a good point to break the chain of references to your object.
- If your graph shows an object which does not appear to be referenced by anything, it may be because this object is on the finalizer queue. The graph hides finalizer queue GC roots by default, because they do not normally indicate a memory problem. To show these objects on the graph, clear the Hide finalizer queue GC roots option (in the bar above the graph).
- If the graph shows your object is being kept in memory by an object on the finalizer queue, take another memory snapshot. Taking a snapshot forces the garbage collector to run, so your object should now be removed from memory.
Was this article helpful?
ANTS Memory Profiler
- Installation error 5100 when installing ANTS Performance Profiler and ANTS Memory Profiler
- Attach to process unavailable with some anti-virus software
- Fragmentation notices in ANTS Memory Profiler 7
- The snapshot failed because .NET did not report every referenced object... manually switch your application to the workstation garbage collector.
- Profiling Sharepoint 2010
- Upgrading to ANTS Memory Profiler 7
- Memory leaks observed when profiling Windows Presentation Framework (WPF) applications
- Windows service profiling fails if the service uses a system account
- Log files
- The type initializer for 'y.layout.hierarchic.ClassicLayerSequencer' threw an exception
- Forcing your application to use .NET 4
- System.EntryPointNotFoundException (Versions: 3,4 only)
- Failed to CoCreate Profiler error profiling a Windows service
- ANTS Profiler code instrumentation method
- Add-in fails to load when using RunAs to start Visual Studio as another user
- Profiling unit tests using Nunit
- Can I profile Compact Framework applications?
- Profiling a SharePoint 2007 Web Part
- Profiling IIS web applications that need to run under the SYSTEM account
- Profiling a web application hosted in IIS on a fixed TCP port
- Profiling client-side XBAP .NET applications
- ANTS Profiler prompts for location of source code which is not your own source code
- ANTS menu remains in Visual Studio after uninstall of ANTS Profiler
- Profiling a web application needing to run as the Network Service account
- Cannot start COM+ application via Remote Desktop
- Profiling BizTalk applications
- Profiling Microsoft Office managed-code add-ins
- The system cannot find the file specified
- Error Stopping IISAdmin profiling IIS web application on Windows XP
- ANTS Memory Profiler total size of all objects does not match the memory footprint of an application
- Creating a global debugging symbols (PDB) directory
- Using the add-in to profile solutions containing more than one project
- Application recycling causes incomplete results and other errors when profiling ASP .NET
- (version 5) Support for profiling Silverlight applications
- Couldn't open metabase error when profiling ASP .NET hosted in IIS
- Failed to coCreate Profiler on ASP .NET web application
- HTTP error 404.17 profiling ASP .NET 1.1 on IIS 7
- Performance counters missing from results
- ANTS Profiler restarts IIS
- Please specify a valid URL message profiling ASP .NET
- Operation could destabilize the runtime error profiling ASP .NET
- IIS ceases to work after profiling web applications
- ANTS Profiler has been split into two distinct programs
- Problems with ANTS Memory Profiler 5 and multiple AppDomains
- System.ArgumentOutOfRangeException or CouldNotMapFileException errors in Memory Profiler 5
- Windows Installer errors 1603 and 2738 occurring during installation
- Unable to coCreate Profiler error profiling any application
- General information about "Private Bytes"
- Profiler stopping while profiling an in-browser Silverlight application
- Error: 'Could not load file or assembly vjslib'
- "No Disk" error occurring while profiling application
- Silverlight out-of-browser profiling stops with no results
- Memory Profiler failing to profile web applications with "unable to connect to server"
all products
- Some Red Gate products identified as containing a trojan by Anti-Virus software
- Activation may fail with Unknown Error -1
- Product uses web help although a CHM file is available locally
- Argument exception resulting from missing environment variable
- Check for updates may fail when used through proxies
- 'Unidentified Publisher' error when repairing or uninstalling
- Licensing activates product as standard edition
- Moving Red Gate software products to another machine
- Red Gate tools log locations
- The application UI opening slowly when there is no internet access
ANTS Memory Profiler
- Activating your products
- Activating your products
- ANTS Memory Profiler release notes - version 6.xx
- ANTS Memory Profiler release notes - version 7.xx
all products
- Red Gate product acknowledgements
- Activating your products
- Activating your products
- Red Gate bundle history
- Check for updates
- Troubleshooting Check for Updates errors
- Current versions
- Deactivating your products
- Installing Red Gate products from the .msi file
- Requesting additional activations
- Serial numbers for bundles
- Reactivating using a different serial number
- Extending your trial
- Finding your serial numbers
- Moving a serial number from one computer to another
- No response received for manual activation
- Licensing and activation resources
- Licensing and activation resources
- Troubleshooting licensing and activation errors
- Licensing and activation FAQs
- Red Gate tools log file locations
- Download old versions of products
- Download product prerequisites & utilities
- Support & upgrades
- Upgrading your software
- Upgrading FAQs




Understanding memory problems