java.lang.Object
com.ibm.dtfj.phd.parser.Base
com.ibm.dtfj.phd.parser.HeapdumpReader
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 Summary
ConstructorsModifierConstructorDescriptionHeapdumpReader(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
Modifier and TypeMethodDescriptionbooleanReturns true all objects in this heap dump will have hashcodes set, regardless of the flags on the record.voidclose()voidReturns 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 voidThis method just prints out the following info from the header: is64Bit phd version full version total objects total refsbooleanparse(PortableHeapDumpListener listener) Parse the heapdump.voidintReturns the total number of objects in the dump.intReturns the total number of references in the dump.intversion()Returns the Phd version number.
-
Constructor Details
-
HeapdumpReader
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
- Throws:
IOException
-
HeapdumpReader
Create a new HeapdumpReader object from the given stream. The file must be in Phd format.- Throws:
IOException
-
HeapdumpReader
Create a new HeapdumpReader object from the given file. The file must be in Phd format.- Throws:
IOException
-
-
Method Details
-
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
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
This method just prints out the following info from the header:- is64Bit
- phd version
- full version
- total objects
- total refs
- Throws:
IOException
-