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
public abstract class GCRootInfo extends Object implements Serializable
Describes a garbage collection root.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceGCRootInfo.TypeReasons why an heap object is a garbage collection root.
-
Constructor Summary
Constructors Constructor Description GCRootInfo(long objectAddress, long contextAddress, int type)Create a description of a Garbage Collection root
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetContextAddress()The object address of the source of the rootintgetContextId()The object id of the source of the root, if there is a sourcelonggetObjectAddress()The object address of the retained objectintgetObjectId()The 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 Detail
-
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 Detail
-
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
public static String getTypeAsString(int type)
A printable version of the type- Parameters:
type- asGCRootInfo.Type- Returns:
- the printable version of the type
- See Also:
GCRootInfo.Type
-
getTypeSetAsString
public static String getTypeSetAsString(GCRootInfo[] roots)
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:
GCRootInfo.Type
-
-