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 classReferenceTreeObject.ReferenceTreeObjectType
-
Field Summary
Fields Modifier and Type Field Description static intFORMAT_ARRAY_INFOstatic intFORMAT_FIELDstatic intFORMAT_OTHER_MODIFIERSstatic intFORMAT_PACKAGEstatic intFORMAT_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
IItemobjects this object keeps alive, including itself
-
getRootDescription
public String getRootDescription()
- Returns:
- the GC root description
-
getAddress
public IQuantity getAddress()
- Specified by:
getAddressin interfaceIMCOldObject
-
getReferrerArray
public IMCOldObjectArray getReferrerArray()
- Specified by:
getReferrerArrayin interfaceIMCOldObject
-
getArray
public IMCOldObjectArray getArray()
- Returns:
- if this object is an array, gets information representing that array,
nullotherwise
-
getChildren
public List<ReferenceTreeObject> getChildren()
- Returns:
- the children of this object
-
getReferrerField
public IMCOldObjectField getReferrerField()
- Specified by:
getReferrerFieldin interfaceIMCOldObject
-
getField
public IMCOldObjectField getField()
- Returns:
- if this object is a field, gets information representing that field,
nullotherwise
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin 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:
getReferrerin interfaceIMCOldObject
-
getTimestamp
public IQuantity getTimestamp()
- Returns:
- the timestamp this object was allocated
-
getType
public IMCType getType()
- Specified by:
getTypein 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:
getReferrerSkipin 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:
displayUsingin 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
-
-