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
Modifier and TypeClassDescriptionstatic interface
Reasons why an heap object is a garbage collection root. -
Constructor Summary
ConstructorDescriptionGCRootInfo
(long objectAddress, long contextAddress, int type) Create a description of a Garbage Collection root -
Method Summary
Modifier and TypeMethodDescriptionlong
The object address of the source of the rootint
The object id of the source of the root, if there is a sourcelong
The object address of the retained objectint
The object id of the retained objectint
getType()
The reason for the rootstatic String
getTypeAsString
(int type) A printable version of the typestatic String
getTypeSetAsString
(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:
-