Package org.eclipse.mat.snapshot
Class MultiplePathsFromGCRootsRecord
java.lang.Object
org.eclipse.mat.snapshot.MultiplePathsFromGCRootsRecord
This class represents a set of paths from the GC roots to different objects,
which go through one and the same object.
-
Constructor Summary
ConstructorDescriptionMultiplePathsFromGCRootsRecord
(int objectId, int level, ISnapshot snapshot) A constructor to create the record -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPath
(int[] path) This method is used only when the record is built.Returns a Comparator ordering the records descending by the number of referenced objects.Returns a Comparator ordering the records descending by the total size of referenced objects.Returns a Comparator ordering the records descending by the total size of referenced objects.int
getCount()
Get the number of paths going through this objectint
getLevel()
Get the level of this recordint
Get the id of the object which is common for all the pathsList<int[]>
getPaths()
Get all the paths going through the object (getObjectId())long
Get the total net heap size of all referenced objects (see getReferencedObjects())int[]
Get the "end" objects for each path.long
Get the total retained heap size of the referenced objectsReturns the next level of the paths.void
setReferencedRetainedSize
(long referencedRetainedSize) Set the retained heap size of the referenced objects
-
Constructor Details
-
MultiplePathsFromGCRootsRecord
A constructor to create the record- Parameters:
objectId
- - the ID of the object which is common for all the pathslevel
- - the level (depth) in the paths where this objects appearssnapshot
- - an ISnapshot object used for further calculation
-
-
Method Details
-
getReferencedRetainedSize
public long getReferencedRetainedSize()Get the total retained heap size of the referenced objects -
setReferencedRetainedSize
public void setReferencedRetainedSize(long referencedRetainedSize) Set the retained heap size of the referenced objects -
nextLevel
Returns the next level of the paths. For all paths going through this object the next objects in the paths are taken and grouped again (i.e. the lenght of the returned array will be equal to the number of different objects at the next depth level of the paths). The direction is from the GC roots to the objects- Returns:
- MultiplePathsFromGCRootsRecord[] Each record in the result represents again paths going through one and the same object
-
addPath
public void addPath(int[] path) This method is used only when the record is built. Adds one path to the set of paths- Parameters:
path
-
-
getPaths
Get all the paths going through the object (getObjectId())- Returns:
- List<int[]> each element in the list is an int[] representing a path
-
getObjectId
public int getObjectId()Get the id of the object which is common for all the paths -
getCount
public int getCount()Get the number of paths going through this object -
getLevel
public int getLevel()Get the level of this record -
getReferencedObjects
public int[] getReferencedObjects()Get the "end" objects for each path. This is equal to getting all the paths and looking at their element [0]- Returns:
- - an array with all the objects at the end of the paths
-
getReferencedHeapSize
Get the total net heap size of all referenced objects (see getReferencedObjects())- Returns:
- - the total heap size of all referenced objects
- Throws:
SnapshotException
-
getComparatorByNumberOfReferencedObjects
Returns a Comparator ordering the records descending by the number of referenced objects. -
getComparatorByReferencedHeapSize
Returns a Comparator ordering the records descending by the total size of referenced objects. -
getComparatorByReferencedRetainedSize
Returns a Comparator ordering the records descending by the total size of referenced objects.
-