Package org.eclipse.mat.snapshot.model
Class GCRootInfo
java.lang.Object
org.eclipse.mat.snapshot.model.GCRootInfo
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
XGCRootInfo
Describes a garbage collection root.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceReasons why an heap object is a garbage collection root. -
Constructor Summary
ConstructorsConstructorDescriptionGCRootInfo(long objectAddress, long contextAddress, int type) Create a description of a Garbage Collection root -
Method Summary
Modifier and TypeMethodDescriptionlongThe object address of the source of the rootintThe object id of the source of the root, if there is a sourcelongThe object address of the retained objectintThe object id of the retained objectintgetType()The reason for the rootstatic StringgetTypeAsString(int type) A printable version of the typestatic StringgetTypeSetAsString(GCRootInfo[] roots) A combined representation of the types of several roots.
-
Constructor Details
-
GCRootInfo
public GCRootInfo(long objectAddress, long contextAddress, int type) Create a description of a Garbage Collection root- Parameters:
objectAddress- the object which is retainedcontextAddress- the source of the retention - e.g. a thread address, or 0 for nonetype- the reason the object is retainedGCRootInfo.Type
-
-
Method Details
-
getObjectId
public int getObjectId()The object id of the retained object- Returns:
- the target object
-
getObjectAddress
public long getObjectAddress()The object address of the retained object- Returns:
- the target object address
-
getContextAddress
public long getContextAddress()The object address of the source of the root- Returns:
- the source object address, or 0 if none
-
getContextId
public int getContextId()The object id of the source of the root, if there is a source- Returns:
- the source object id
-
getType
public int getType()The reason for the root- Returns:
- A number representing the type as
GCRootInfo.Type
-
getTypeAsString
A printable version of the type- Parameters:
type- asGCRootInfo.Type- Returns:
- the printable version of the type
- See Also:
-
getTypeSetAsString
A combined representation of the types of several roots. The types are currently separated by commas, but this could change e.g. for NLS reasons?- Parameters:
roots- an array of roots to get the combined type from- Returns:
- A combined type
- See Also:
-