Find out who is keeping alive a set of objects.
Having found an expensive object it is then important to find all the reasons it is kept alive.
Unlike the Path to GC roots query, this query can operate on multiple objects. However, it only finds the shortest path to GC roots; there may be other paths, but this query does not show them. As it operates on multiple objects there are multiple paths, and the query has the option to merge objects on a path by class. Seeing a common path can be useful in understanding why a set of objects is being kept alive.
Argument | Description |
---|---|
objects | Objects for which paths to garbage collection roots should be found. |
-excludes | Fields of certain classes which should be ignored when finding paths. For example this allows paths through Weak or Soft Reference referents to be ignored. This is of the format class name pattern [: field name [, field name ]*]. Subclasses of the class are also included. If no field names are specified for the class then all fields are excluded. |
-groupby |
Whether to show:
|
The tree shows objects or sets of objects grouped by class on a path to or from GC roots. The Referenced Objects column shows how many of the objects supplied to this query are on a path through this row.
The context menu allows the objects on this segment of the path, or the referenced objects through this path to be separately examined with other queries.
Merge shortest paths from GC roots