Class ReferenceTreeObject

    • Constructor Detail

      • ReferenceTreeObject

        ReferenceTreeObject​(IQuantity timestamp,
                            IMCOldObject object)
        Parameters:
        timestamp - a timestamp representing when the object was allocated
        object - the object itself
    • Method Detail

      • setDistanceFromRoot

        void setDistanceFromRoot​(int distance)
        Parameters:
        distance - the distance from the root object
      • getDistanceFromRoot

        public int getDistanceFromRoot()
        Returns:
        the number of steps in a referral chain from the root object
      • setLeakRelevance

        void setLeakRelevance​(double relevance)
        Parameters:
        relevance - how relevant this object is as a leak candidate
      • getLeakRelevance

        public double getLeakRelevance()
        Returns:
        the relevance of this object for memory leak detection
      • addChild

        void addChild​(ReferenceTreeObject node)
        Parameters:
        node - a child to be added to this object
      • addItem

        void addItem​(IItem item)
        Parameters:
        item - an item this object keeps alive
      • getItems

        public java.util.Set<IItem> getItems()
        This method is used when it is necessary to get information about all objects this object keeps alive in the ReferenceTreeModel. 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
      • addRoot

        void addRoot​(IMCOldObjectGcRoot root)
        Parameters:
        root - a GC root description
      • getRootDescription

        public java.lang.String getRootDescription()
        Returns:
        the GC root description
      • getAddress

        public IQuantity getAddress()
        Description copied from interface: IMCOldObject
        The address of the object, used for identity purposes.
        Specified by:
        getAddress in interface IMCOldObject
        Returns:
        the address of the object
      • getReferrerArray

        public IMCOldObjectArray getReferrerArray()
        Description copied from interface: IMCOldObject
        If the object is referred to by an object in an array it returns the information about that array, otherwise it returns null.
        Specified by:
        getReferrerArray in interface IMCOldObject
        Returns:
        a representation of the array data for the object referring to this old object
      • getArray

        public IMCOldObjectArray getArray()
        Returns:
        if this object is an array, gets information representing that array, null otherwise
      • getChildren

        public java.util.List<ReferenceTreeObject> getChildren()
        Returns:
        the children of this object
      • getReferrerField

        public IMCOldObjectField getReferrerField()
        Description copied from interface: IMCOldObject
        If the object is referred to by an object in a field it returns a representation of the field, null otherwise.
        Specified by:
        getReferrerField in interface IMCOldObject
        Returns:
        a representation of the field that refers to this object
      • getField

        public IMCOldObjectField getField()
        Returns:
        if this object is a field, gets information representing that field, null otherwise
      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: IMCOldObject
        Returns a description of the object.
        Specified by:
        getDescription in interface IMCOldObject
        Returns:
        the object description
      • 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()
        Description copied from interface: IMCOldObject
        Returns the object that refers to this object in the heap reference chain.
        Specified by:
        getReferrer in interface IMCOldObject
        Returns:
        the object that refers to this object
      • getTimestamp

        public IQuantity getTimestamp()
        Returns:
        the timestamp this object was allocated
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • incrementObjectsKeptAliveCount

        void incrementObjectsKeptAliveCount()
        Increments the number of objects this object keeps alive.
      • setParent

        public void setParent​(ReferenceTreeObject parent)
        Parameters:
        parent - the parent of this object
      • getReferrerSkip

        public int getReferrerSkip()
        Description copied from interface: IMCOldObject
        Returns the number of steps away in the reference chain this object is from the next object referring to it. If this is greater than 0, it means that there are objects between this one and the referrer that were omitted when committing the traces to the Flight Recording file.
        Specified by:
        getReferrerSkip in interface IMCOldObject
        Returns:
        the number of steps between this object and the next one towards the root in the reference chain
      • getOldObjectSamples

        public java.util.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
      • toString

        public java.lang.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 in ReferenceTreeObject
        Returns:
        a human readable string representation of this object