Class ReferenceTreeObject
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.memleak.ReferenceTreeObject
-
- All Implemented Interfaces:
IDisplayable
,IMCOldObject
public class ReferenceTreeObject extends Object implements IMCOldObject, IDisplayable
A data type representing alive objects in a Java heap used in aReferenceTreeModel
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReferenceTreeObject.ReferenceTreeObjectType
-
Field Summary
Fields Modifier and Type Field Description static int
FORMAT_ARRAY_INFO
static int
FORMAT_FIELD
static int
FORMAT_OTHER_MODIFIERS
static int
FORMAT_PACKAGE
static int
FORMAT_STATIC_MODIFIER
-
Fields inherited from interface org.openjdk.jmc.common.IDisplayable
AUTO, EXACT, VERBOSE
-
-
Method Summary
-
-
-
Field Detail
-
FORMAT_PACKAGE
public static final int FORMAT_PACKAGE
- See Also:
- Constant Field Values
-
FORMAT_FIELD
public static final int FORMAT_FIELD
- See Also:
- Constant Field Values
-
FORMAT_STATIC_MODIFIER
public static final int FORMAT_STATIC_MODIFIER
- See Also:
- Constant Field Values
-
FORMAT_OTHER_MODIFIERS
public static final int FORMAT_OTHER_MODIFIERS
- See Also:
- Constant Field Values
-
FORMAT_ARRAY_INFO
public static final int FORMAT_ARRAY_INFO
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDistanceFromRoot
public int getDistanceFromRoot()
- Returns:
- the number of steps in a referral chain from the root object
-
getLeakRelevance
public double getLeakRelevance()
- Returns:
- the relevance of this object for memory leak detection
-
getItems
public Set<IItem> getItems()
This method is used when it is necessary to get information about all objects this object keeps alive in theReferenceTreeModel
. E.g. the Mission Control GUI uses this when a user selects a row in the tree to show everything below it as well in the properties view.- Returns:
- a set representing all
IItem
objects this object keeps alive, including itself
-
getRootDescription
public String getRootDescription()
- Returns:
- the GC root description
-
getAddress
public IQuantity getAddress()
- Specified by:
getAddress
in interfaceIMCOldObject
-
getReferrerArray
public IMCOldObjectArray getReferrerArray()
- Specified by:
getReferrerArray
in interfaceIMCOldObject
-
getArray
public IMCOldObjectArray getArray()
- Returns:
- if this object is an array, gets information representing that array,
null
otherwise
-
getChildren
public List<ReferenceTreeObject> getChildren()
- Returns:
- the children of this object
-
getReferrerField
public IMCOldObjectField getReferrerField()
- Specified by:
getReferrerField
in interfaceIMCOldObject
-
getField
public IMCOldObjectField getField()
- Returns:
- if this object is a field, gets information representing that field,
null
otherwise
-
getDescription
public String getDescription()
- Specified by:
getDescription
in interfaceIMCOldObject
-
getObjectsKeptAliveCount
public int getObjectsKeptAliveCount()
- Returns:
- the number of objects this object keeps alive
-
getParent
public ReferenceTreeObject getParent()
This method returns an object that is keeping this object alive.- Returns:
- the object linking to this object from the direction of the gc root
-
getReferrer
public IMCOldObject getReferrer()
- Specified by:
getReferrer
in interfaceIMCOldObject
-
getTimestamp
public IQuantity getTimestamp()
- Returns:
- the timestamp this object was allocated
-
getType
public IMCType getType()
- Specified by:
getType
in interfaceIMCOldObject
-
setParent
public void setParent(ReferenceTreeObject parent)
- Parameters:
parent
- the parent of this object
-
getRootObject
public ReferenceTreeObject getRootObject()
- Returns:
- the Root object
-
getReferrerSkip
public int getReferrerSkip()
- Specified by:
getReferrerSkip
in interfaceIMCOldObject
-
getOldObjectSamples
public Map<IQuantity,ReferenceTreeObject> getOldObjectSamples()
- Returns:
- Map containing allocation time and its oldObjectReference object
-
updateOldObjectSamples
public void updateOldObjectSamples(ReferenceTreeObject oldobjectrefnode)
This method updates the Root object's Map with allocationTime and its oldObjectReference object (leaves).- Parameters:
oldobjectrefnode
- oldObjectReference leaf node
-
displayUsing
public String displayUsing(String hint)
- Specified by:
displayUsing
in interfaceIDisplayable
-
toString
public String toString(int displayFormatting)
Returns a string representation of this object.- Parameters:
displayFormatting
- an int describing how this object is to be represented, using bitwise masking of constants defined inReferenceTreeObject
- Returns:
- a human readable string representation of this object
-
-