Module openj9.dtfj

Class HeapdumpReader

java.lang.Object
com.ibm.dtfj.phd.parser.Base
com.ibm.dtfj.phd.parser.HeapdumpReader

public class HeapdumpReader extends Base
This class parses a PHD format heapdump file. To use it, first create the object (see HeapdumpReader(java.lang.String)) passing the file name and then parse it (see parse(com.ibm.dtfj.phd.parser.PortableHeapDumpListener)) passing it an object that obeys the PortableHeapDumpListener interface.
  • Constructor Details

    • HeapdumpReader

      public HeapdumpReader(File file, PHDImage image) throws IOException
      Create a new HeapdumpReader object from the given file. The file must be in Phd format. Image must be supplied to allow us to clean up streams when it is closed.
      Throws:
      IOException
    • HeapdumpReader

      public HeapdumpReader(ImageInputStream stream, PHDImage image) throws IOException
      Throws:
      IOException
    • HeapdumpReader

      protected HeapdumpReader(ImageInputStream stream) throws IOException
      Create a new HeapdumpReader object from the given stream. The file must be in Phd format.
      Throws:
      IOException
    • HeapdumpReader

      protected HeapdumpReader(String filename) throws IOException
      Create a new HeapdumpReader object from the given file. The file must be in Phd format.
      Throws:
      IOException
  • Method Details

    • full_version

      public String full_version()
      Returns the full version for the JVM that created this heapdump.
    • version

      public int version()
      Returns the Phd version number. Recognized values are 4 and 5.
    • is64Bit

      public boolean is64Bit()
      Returns true if this is a 64-bit heap dump.
    • isJ9

      public boolean isJ9()
      Returns true if this is a J9 heap dump.
    • allObjectsHashed

      public boolean allObjectsHashed()
      Returns true all objects in this heap dump will have hashcodes set, regardless of the flags on the record.
    • totalObjects

      public int totalObjects()
      Returns the total number of objects in the dump.
    • totalRefs

      public int totalRefs()
      Returns the total number of references in the dump.
    • exitParse

      public void exitParse()
    • parse

      public boolean parse(PortableHeapDumpListener listener) throws Exception
      Parse the heapdump. This uses callbacks via the PortableHeapDumpListener interface. Any exceptions that the listener raises are propagated back.
      Returns:
      true if there is more data to parse
      Throws:
      Exception
    • close

      public void close()
    • releaseResources

      public void releaseResources()
    • main

      public static void main(String[] args) throws IOException
      This method just prints out the following info from the header:
      • is64Bit
      • phd version
      • full version
      • total objects
      • total refs
      Throws:
      IOException