Module openj9.dtfj

Class GCHeapMap

java.lang.Object
com.ibm.j9ddr.vm29.j9.gc.GCHeapMap
Direct Known Subclasses:
GCMarkMap

public abstract class GCHeapMap extends Object
  • Field Details

    • J9BITS_BITS_IN_SLOT

      public static final long J9BITS_BITS_IN_SLOT
    • BITS_IN_BYTES

      public static final long BITS_IN_BYTES
      See Also:
    • J9MODRON_HEAP_SLOTS_PER_HEAPMAP_SLOT

      public static final UDATA J9MODRON_HEAP_SLOTS_PER_HEAPMAP_SLOT
    • J9MODRON_HEAP_BYTES_PER_HEAPMAP_BIT

      public static final UDATA J9MODRON_HEAP_BYTES_PER_HEAPMAP_BIT
    • J9MODRON_HEAP_BYTES_PER_HEAPMAP_BYTE

      public static final UDATA J9MODRON_HEAP_BYTES_PER_HEAPMAP_BYTE
    • J9MODRON_HEAP_BYTES_PER_HEAPMAP_SLOT

      public static final UDATA J9MODRON_HEAP_BYTES_PER_HEAPMAP_SLOT
    • _heapMap

      protected com.ibm.j9ddr.vm29.pointer.generated.MM_HeapMapPointer _heapMap
    • _heapBase

      protected VoidPointer _heapBase
    • _heapTop

      protected VoidPointer _heapTop
    • _heapMapBits

      protected UDATAPointer _heapMapBits
    • _maxOffset

      protected UDATA _maxOffset
    • _heapMapIndexShift

      protected UDATA _heapMapIndexShift
    • _heapMapBitMask

      protected UDATA _heapMapBitMask
    • _heapMapBitShift

      protected UDATA _heapMapBitShift
  • Constructor Details

  • Method Details

    • from

      public static GCHeapMap from() throws CorruptDataException
      Throws:
      CorruptDataException
    • fromHeapMap

      public static GCHeapMap fromHeapMap(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapMapPointer heapMap) throws CorruptDataException
      Throws:
      CorruptDataException
    • getHeapMap

      public com.ibm.j9ddr.vm29.pointer.generated.MM_HeapMapPointer getHeapMap()
    • getHeapBase

      public VoidPointer getHeapBase()
    • getHeapMapBits

      public UDATAPointer getHeapMapBits()
    • getHeapTop

      public VoidPointer getHeapTop()
    • getObjectGrain

      public int getObjectGrain()
    • getPageSize

      public int getPageSize(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
    • getSlotIndexAndMask

      public UDATA[] getSlotIndexAndMask(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Return the index into the heap map bits array and the bitmask to use.
      Parameters:
      object -
      Returns:
      an array containing the slot index and bit mask
    • isBitSet

      public boolean isBitSet(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer address) throws CorruptDataException
      Check if a bit is set in the GCHeapMap
      Parameters:
      address - Must be a pointer into the heap. The pointer must point to committed heap memory.
      Returns:
      True if the bit is set. False otherwise.
      Throws:
      CorruptDataException
    • isMarked

      public boolean isMarked(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer address) throws CorruptDataException
      Check if a bit is set in the GCHeapMap. Differs from isBitSet(J9Object) in that it will return true if the address is not in the heap.
      Parameters:
      address - An address. If the address is not in the Heap, will return True.
      Returns:
      True if the bit is set. True if the address of the object is not in the heap. False otherwise.
      Throws:
      CorruptDataException
    • isBitSetNoCheck

      protected boolean isBitSetNoCheck(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object) throws CorruptDataException
      Check if a bit is set without checking the pointer. Will throw an exception if the pointer is forces HeapMap to read from uncommitted memory.
      Parameters:
      object -
      Throws:
      CorruptDataException
    • queryObject

      public GCHeapMap.MarkedObject queryObject(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object) throws CorruptDataException
      Query the mark map to see if the specified object is found. If so return a MarkedObject describing it, otherwise null.
      Parameters:
      object - The object to query
      Returns:
      A MarkedObject, or null
      Throws:
      CorruptDataException
    • queryRange

      public GCHeapMap.MarkedObject[] queryRange(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer base, com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer top) throws CorruptDataException
      Query the mark map to see what objects are marked within the specified range. Return an array of MarkedObject records describing each entry found.
      Parameters:
      base - Bottom of the range to query (inclusive)
      top - Top of the range to query (exclusive)
      Returns:
      A MarkedObject[] containing the results
      Throws:
      CorruptDataException