public interface IPathsFromGCRootsComputer
ISnapshot
API.
Finding paths from GC roots to an object is handy if you want to learn which objects are responsible for the given object to remain in memory. Since the snapshot implementation artificially creates references from the object to its class and from the class to its class loader you can even see why a class or class loader remains in memory, i.e. which other objects hold references to objects of the class or class loader of interest.
Modifier and Type | Method and Description |
---|---|
int[] |
getNextShortestPath()
Get next shortest path.
|
PathsFromGCRootsTree |
getTree(Collection<int[]> paths)
Helper method constructing a tree like data structure from the given
paths.
|
int[] getNextShortestPath() throws SnapshotException
This method allows you either to ask for all paths (which could take quite some time and memory but shows you the complete picture) or one by one (the shortest paths are returned first; more useful in an UI as a user might find a problem faster among just a few shorter paths).
SnapshotException
PathsFromGCRootsTree getTree(Collection<int[]> paths)
paths
- paths from GC roots previously returned by
getNextShortestPath()