Class MultiplePathsFromGCRootsClassRecord


  • public class MultiplePathsFromGCRootsClassRecord
    extends Object
    Holds one level of multiple paths from Garbage Collection roots merged by class.
    • Constructor Detail

      • MultiplePathsFromGCRootsClassRecord

        public MultiplePathsFromGCRootsClassRecord​(IClass clazz,
                                                   int level,
                                                   boolean fromRoots,
                                                   ISnapshot snapshot)
        Constructor
        Parameters:
        clazz - the class in question
        level -
        fromRoots - true means from roots, false means to roots
        snapshot -
    • Method Detail

      • addPath

        public void addPath​(int[] path)
        This method is used only when the record is built. Adds one path to the set of paths
        Parameters:
        path -
      • getPaths

        public List<int[]> getPaths()
        Get all the paths going through the object (getObjectId())
        Returns:
        List<int[]> each element in the list is an int[] representing a path
      • getCount

        public int getCount()
        Get the number of paths going through this object
      • getDistinctCount

        public int getDistinctCount()
        Get the number of distinct objects of this class
      • getReferencedHeapSize

        public long getReferencedHeapSize()
                                   throws SnapshotException
        Get the total net heap size of all referenced objects (see getReferencedObjects())
        Returns:
        - the total heap size of all referenced objects
        Throws:
        SnapshotException
      • getReferencedObjects

        public int[] getReferencedObjects()
        Get the "end" objects for each path. This is equal to getting all the paths and looking at their element [0]
        Returns:
        - an array with all the objects at the end of the paths
      • getComparatorByReferencedHeapSize

        public static Comparator<MultiplePathsFromGCRootsClassRecord> getComparatorByReferencedHeapSize()
        Returns a Comparator ordering the records descending by the total size of referenced objects.
      • getClazz

        public IClass getClazz()
      • isFromRoots

        public boolean isFromRoots()
      • getLevel

        public int getLevel()