Class PortableHeapDumpFormatter
java.lang.Object
com.ibm.jvm.dtfjview.heapdump.HeapDumpFormatter
com.ibm.jvm.dtfjview.heapdump.portable.PortableHeapDumpFormatter
A formatter for Portable heap dumps (PHDs).
Format documented here: http://w3.hursley.ibm.com/~dgriff/newphd.html
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final byte
static final byte
static final byte
static final byte
static final byte
static final int
static final int
static final byte
static final byte
static final String
static final byte
static final byte
static final int
static final byte
static final byte
static final byte
static final byte
Fields declared in class com.ibm.jvm.dtfjview.heapdump.HeapDumpFormatter
_is64Bit, _version
-
Constructor Summary
ConstructorDescriptionPortableHeapDumpFormatter
(DataOutputStream output, String version, boolean is64Bit, boolean is32BitHash) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addClass
(long address, String name, long superClassAddress, int size, long instanceSize, int hashCode, ReferenceIterator references) Adds a class to the heapdump.void
addObject
(long address, long classAddress, String className, int size, int hashCode, ReferenceIterator references) Adds an object to the heapdump.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.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 - longvoid
close()
Closes the heapdump
-
Field Details
-
MAGIC_STRING
- See Also:
-
PHD_VERSION_NUMBER
public static final int PHD_VERSION_NUMBER- See Also:
-
START_OF_HEADER_TAG
public static final byte START_OF_HEADER_TAG- See Also:
-
END_OF_HEADER_TAG
public static final byte END_OF_HEADER_TAG- See Also:
-
START_OF_DUMP_TAG
public static final byte START_OF_DUMP_TAG- See Also:
-
END_OF_DUMP_TAG
public static final byte END_OF_DUMP_TAG- See Also:
-
HASHCODE_RANDOM_TAG
public static final byte HASHCODE_RANDOM_TAG- See Also:
-
FULL_VERSION_TAG
public static final byte FULL_VERSION_TAG- See Also:
-
IS_64_BIT_HEADER_FLAG
public static final int IS_64_BIT_HEADER_FLAG- See Also:
-
ALL_OBJECTS_HASHED_FLAG
public static final int ALL_OBJECTS_HASHED_FLAG- See Also:
-
IS_J9_HEADER_FLAG
public static final int IS_J9_HEADER_FLAG- See Also:
-
CLASS_RECORD_TAG
public static final byte CLASS_RECORD_TAG- See Also:
-
SHORT_OBJECT_RECORD_TAG
public static final byte SHORT_OBJECT_RECORD_TAG- See Also:
-
MEDIUM_OBJECT_RECORD_TAG
public static final byte MEDIUM_OBJECT_RECORD_TAG- See Also:
-
LONG_OBJECT_RECORD_TAG
public static final byte LONG_OBJECT_RECORD_TAG- See Also:
-
OBJECT_ARRAY_RECORD_TAG
public static final byte OBJECT_ARRAY_RECORD_TAG- See Also:
-
PRIMITIVE_ARRAY_RECORD_TAG
public static final byte PRIMITIVE_ARRAY_RECORD_TAG- See Also:
-
LONG_PRIMITIVE_ARRAY_RECORD_TAG
public static final byte LONG_PRIMITIVE_ARRAY_RECORD_TAG- See Also:
-
-
Constructor Details
-
PortableHeapDumpFormatter
public PortableHeapDumpFormatter(DataOutputStream output, String version, boolean is64Bit, boolean is32BitHash) throws IOException - Throws:
IOException
-
-
Method Details
-
addClass
public void addClass(long address, String name, long superClassAddress, int size, long instanceSize, int hashCode, ReferenceIterator references) throws IOException Description copied from class:HeapDumpFormatter
Adds a class to the heapdump.- Specified by:
addClass
in classHeapDumpFormatter
- Parameters:
address
- Address of classname
- Name of classsuperClassAddress
- Address of superclasssize
- Size of class, bytesinstanceSize
- Size of objects of this classhashCode
- Hashcodereferences
- Iterator of Long addresses (some of which may be null)- Throws:
IOException
-
addObject
public void addObject(long address, long classAddress, String className, int size, int hashCode, ReferenceIterator references) throws IOException Description copied from class:HeapDumpFormatter
Adds an object to the heapdump.- Specified by:
addObject
in classHeapDumpFormatter
- Parameters:
address
- Address of objectclassAddress
- Address of class of objectclassName
- Name of class of objectsize
- Size of object, byteshashCode
- Hashcode of objectreferences
- Iterator of Long addresses (some of which may be null)- Throws:
IOException
-
addObjectArray
public void addObjectArray(long address, long arrayClassAddress, String arrayClassName, long elementClassAddress, String elementClassName, long size, int numberOfElements, int hashCode, ReferenceIterator references) throws IOException Description copied from class:HeapDumpFormatter
Adds an object array to the heapdump.- Specified by:
addObjectArray
in classHeapDumpFormatter
- Parameters:
address
- Address of objectarrayClassAddress
- Address of class of array objectarrayClassName
- Name of class of array objectelementClassAddress
- Address of class of elementselementClassName
- Name of class of elementssize
- 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 longnumberOfElements
- number of elements in the arrayhashCode
- Hashcode of objectreferences
- Iterator of Long addresses (some of which may be null)- Throws:
IOException
-
addPrimitiveArray
public void addPrimitiveArray(long address, long arrayClassAddress, int type, long size, int hashCode, int numberOfElements) throws IOException, IllegalArgumentException Description copied from class:HeapDumpFormatter
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- Specified by:
addPrimitiveArray
in classHeapDumpFormatter
- Parameters:
address
- Address of objectarrayClassAddress
- Address of primitive array classtype
- Type code - see abovesize
- 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 longhashCode
- Hashcode of objectnumberOfElements
- Number of elements in the array- Throws:
IOException
IllegalArgumentException
- if invalid type is supplied
-
close
Description copied from class:HeapDumpFormatter
Closes the heapdump- Specified by:
close
in classHeapDumpFormatter
- Throws:
IOException
-