Class HeapDumpFormatter

java.lang.Object
com.ibm.jvm.dtfjview.heapdump.HeapDumpFormatter
Direct Known Subclasses:
ClassicHeapDumpFormatter, PortableHeapDumpFormatter

public abstract class HeapDumpFormatter extends Object
Abstract class to decouple the formatting of heapdumps from the walking of the internal data structures that hold the source data.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final boolean
     
    protected final String
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    HeapDumpFormatter(String version, boolean is64Bit)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    addClass(long address, String name, long superClassAddress, int size, long instanceSize, int hashCode, ReferenceIterator references)
    Adds a class to the heapdump.
    abstract void
    addObject(long address, long classAddress, String className, int size, int hashCode, ReferenceIterator references)
    Adds an object to the heapdump.
    abstract void
    addObjectArray(long address, long arrayClassAddress, String arrayClassName, long elementClassAddress, String elementClassName, long size, int numberOfElements, int hashCode, ReferenceIterator references)
    Adds an object array to the heapdump.
    abstract void
    addPrimitiveArray(long address, long arrayClassAddress, int type, long size, int hashCode, int numberOfElements)
    Adds a primitive array object to the heapdump Type code is: 0 - bool, 1 - char, 2 - float, 3 - double, 4 - byte, 5 - short, 6 - int, 7 - long
    abstract void
    Closes the heapdump

    Methods declared in class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _version

      protected final String _version
    • _is64Bit

      protected final boolean _is64Bit
  • Constructor Details

    • HeapDumpFormatter

      protected HeapDumpFormatter(String version, boolean is64Bit)
      Constructor
      Parameters:
      version - JVM version information to be included in heapdump header
      is64Bit - True if we are dumping a 64 bit image, false otherwise
  • Method Details

    • addClass

      public abstract void addClass(long address, String name, long superClassAddress, int size, long instanceSize, int hashCode, ReferenceIterator references) throws IOException
      Adds a class to the heapdump.
      Parameters:
      address - Address of class
      name - Name of class
      superClassAddress - Address of superclass
      size - Size of class, bytes
      instanceSize - Size of objects of this class
      hashCode - Hashcode
      references - Iterator of Long addresses (some of which may be null)
      Throws:
      IOException
    • addObject

      public abstract void addObject(long address, long classAddress, String className, int size, int hashCode, ReferenceIterator references) throws IOException
      Adds an object to the heapdump.
      Parameters:
      address - Address of object
      classAddress - Address of class of object
      className - Name of class of object
      size - Size of object, bytes
      hashCode - Hashcode of object
      references - Iterator of Long addresses (some of which may be null)
      Throws:
      IOException
    • addPrimitiveArray

      public abstract void addPrimitiveArray(long address, long arrayClassAddress, int type, long size, int hashCode, int numberOfElements) throws IOException, IllegalArgumentException
      Adds a primitive array object to the heapdump Type code is: 0 - bool, 1 - char, 2 - float, 3 - double, 4 - byte, 5 - short, 6 - int, 7 - long
      Parameters:
      address - Address of object
      arrayClassAddress - Address of primitive array class
      type - Type code - see above
      size - Size of object, bytes. Since version 6 PHD, instance size is in the PHD and can be larger than max signed int so pass as a long
      hashCode - Hashcode of object
      numberOfElements - Number of elements in the array
      Throws:
      IOException
      IllegalArgumentException - if invalid type is supplied
    • addObjectArray

      public abstract void addObjectArray(long address, long arrayClassAddress, String arrayClassName, long elementClassAddress, String elementClassName, long size, int numberOfElements, int hashCode, ReferenceIterator references) throws IOException
      Adds an object array to the heapdump.
      Parameters:
      address - Address of object
      arrayClassAddress - Address of class of array object
      arrayClassName - Name of class of array object
      elementClassAddress - Address of class of elements
      elementClassName - Name of class of elements
      size - Size of object, bytes Since version 6 PHD, instance size is in the PHD and can be larger than max signed int so pass as a long
      numberOfElements - number of elements in the array
      hashCode - Hashcode of object
      references - Iterator of Long addresses (some of which may be null)
      Throws:
      IOException
    • close

      public abstract void close() throws IOException
      Closes the heapdump
      Throws:
      IOException