Use the Follow References dashlet to inspect the references for an instance, or a set of all Instances of a class. Since it requires instance information, it is only available for Leak Analysis snapshots. Use it to follow referring instances (Referrers), as well as referenced Instances (Referees). Use the tabs at the bottom of the dashlet to switch between Referrer and Referee analysis.
To access the dialog box, right click the required class in the Total Memory Content dashlet, and select Follow Reference > By Keep Alive or Follow Reference > Direct from the context menu.
By default, the Follow References dashlet does not show references from or to classes. Click Ctrl+F to open the filter bar and then click to change this.
By keep alive
Follow references by Keep Alive to show the (usually indirect) Referrer that keeps an instance alive, or Referee that is kept alive by an instance. The references are not the direct references of the object graph on the heap but the Referrers or Referees on the Keep Alive Graph. References by Keep Alive are more lightweight than direct references. Use them to determine why an instance is not garbage collected. Only one single instance can be the Keep-Alive-Referrer of another instance. If an instance is referred by two instances, the Keep Alive Referrer is the first Referrer up the Referrer-Hierarchy that exclusively and indirectly references the instance. If there is no such record (as the instance is indirectly referenced by multiple Heap roots) the virtual
<VMRoot> record is shown. See Keep Alive Graph for more information.
When you follow References Direct, the instance Referrer/Referee is shown as found in the VM/CLR Heap. The table shows the following columns:
- Class/Instance: Class or instance that is referring or referenced. If the record is already contained in the tree up to the original record, a LOOP tag is added to indicate a loop. It usually does not make sense to further follow loops.
- Type: Reference type as reported by the VM. Tooltips show a textual representation of the shown icon.
- Referring instances: Referring field name as defined in the source code of the corresponding class.
- Referenced parents: Referenced field name as defined in the source code of the corresponding class.
- GC Size: Garbage collection size of the instance.
- Shallow Size: Shallow size of the instance.
- Additional Information: Data related to the record. For strings, it shows the string value if string-value capturing was enabled. For most collections, it shows the collection size if capturing primitive values was enabled.
Click a class record to follow the references of all instances of a class in the Total Memory Content Dashlet. This generates an aggregated view of Referrers or Referees. Every instance of the class is investigated, and the corresponding references are grouped by their classes.
The columns Referring instances / Referenced parents count the number of instances that are referring / referenced by a higher level node. To further analyze referring instances, select Show Instances in the context menu to open them in a new Total Memory Content dashlet.
For aggregated reference analysis, the GC Size column displays the Garbage Collection Size of the referring/referenced instances only, whereas shared children are considered.