- 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 (seeHeapdumpReader(java.lang.String)) passing the file name and then parse it (seeparse(com.ibm.dtfj.phd.parser.PortableHeapDumpListener)) passing it an object that obeys thePortableHeapDumpListenerinterface.
-
-
Constructor Summary
Constructors Modifier Constructor Description HeapdumpReader(File file, PHDImage image)Create a new HeapdumpReader object from the given file.protectedHeapdumpReader(String filename)Create a new HeapdumpReader object from the given file.protectedHeapdumpReader(ImageInputStream stream)Create a new HeapdumpReader object from the given stream.HeapdumpReader(ImageInputStream stream, PHDImage image)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallObjectsHashed()Returns true all objects in this heap dump will have hashcodes set, regardless of the flags on the record.voidclose()voidexitParse()Stringfull_version()Returns the full version for the JVM that created this heapdump.booleanis64Bit()Returns true if this is a 64-bit heap dump.booleanisJ9()Returns true if this is a J9 heap dump.static voidmain(String[] args)This method just prints out the following info from the header: is64Bit phd version full version total objects total refsbooleanparse(PortableHeapDumpListener listener)Parse the heapdump.voidreleaseResources()inttotalObjects()Returns the total number of objects in the dump.inttotalRefs()Returns the total number of references in the dump.intversion()Returns the Phd version number.
-
-
-
Constructor Detail
-
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 Detail
-
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
-
-