Class HeapDumpFormatter
java.lang.Object
com.ibm.jvm.dtfjview.heapdump.HeapDumpFormatter
- Direct Known Subclasses:
ClassicHeapDumpFormatter
,PortableHeapDumpFormatter
Abstract class to decouple the formatting of heapdumps from the walking of
the internal data structures that hold the source data.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
HeapDumpFormatter
(String version, boolean is64Bit) Constructor -
Method Summary
Modifier and TypeMethodDescriptionabstract 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 - longabstract void
close()
Closes the heapdump
-
Field Details
-
_version
-
_is64Bit
protected final boolean _is64Bit
-
-
Constructor Details
-
HeapDumpFormatter
Constructor- Parameters:
version
- JVM version information to be included in heapdump headeris64Bit
- 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 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 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 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
-
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 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
-
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 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
-
close
-