Package org.openjdk.jol.heap
Class HeapDumpReader
- java.lang.Object
-
- org.openjdk.jol.heap.HeapDumpReader
-
public class HeapDumpReader extends java.lang.Object
Experimental heap dump reader
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
buf
private Multiset<ClassData>
classCounts
private java.util.Map<java.lang.Long,ClassData>
classDatas
private java.util.Map<java.lang.Long,java.lang.String>
classNames
private java.io.File
file
private java.lang.String
header
private int
idSize
private java.io.InputStream
is
private long
readBytes
private java.util.Map<java.lang.Long,java.lang.String>
strings
private java.nio.ByteBuffer
wrapBuf
-
Constructor Summary
Constructors Constructor Description HeapDumpReader(java.io.File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
digestClass()
private void
digestHeapDump()
private void
digestInstance()
private void
digestObjArray()
private void
digestPrimArray()
private java.lang.String
errorMessage(java.lang.String message)
private int
getSize(int type)
private java.lang.String
getTypeString(int type)
Multiset<ClassData>
parse()
private int
read()
private int
read(byte[] b, int size)
(package private) byte[]
read_contents(long len)
private long
read_ID()
(package private) byte[]
read_null(long len)
(package private) int
read_U1()
(package private) int
read_U2()
(package private) long
read_U4()
(package private) long
read_U8()
(package private) java.lang.String
readNullTerminated()
(package private) java.lang.String
readString(long len)
private long
readValue(int type)
protected void
visitClass(long id, java.lang.String name, java.util.List<java.lang.Integer> oopIdx, int oopSize)
protected void
visitInstance(long id, long klassID, byte[] bytes)
protected void
visitPrimArray(long id, java.lang.String componentType, int count, byte[] bytes)
-
-
-
Field Detail
-
is
private final java.io.InputStream is
-
strings
private final java.util.Map<java.lang.Long,java.lang.String> strings
-
classNames
private final java.util.Map<java.lang.Long,java.lang.String> classNames
-
classDatas
private final java.util.Map<java.lang.Long,ClassData> classDatas
-
file
private final java.io.File file
-
idSize
private int idSize
-
readBytes
private long readBytes
-
buf
private final byte[] buf
-
wrapBuf
private final java.nio.ByteBuffer wrapBuf
-
header
private java.lang.String header
-
-
Method Detail
-
read
private int read() throws HeapDumpException
- Throws:
HeapDumpException
-
read
private int read(byte[] b, int size) throws HeapDumpException
- Throws:
HeapDumpException
-
parse
public Multiset<ClassData> parse() throws java.io.IOException, HeapDumpException
- Throws:
java.io.IOException
HeapDumpException
-
digestHeapDump
private void digestHeapDump() throws HeapDumpException
- Throws:
HeapDumpException
-
digestPrimArray
private void digestPrimArray() throws HeapDumpException
- Throws:
HeapDumpException
-
digestObjArray
private void digestObjArray() throws HeapDumpException
- Throws:
HeapDumpException
-
digestInstance
private void digestInstance() throws HeapDumpException
- Throws:
HeapDumpException
-
digestClass
private void digestClass() throws HeapDumpException
- Throws:
HeapDumpException
-
readValue
private long readValue(int type) throws HeapDumpException
- Throws:
HeapDumpException
-
getSize
private int getSize(int type) throws HeapDumpException
- Throws:
HeapDumpException
-
getTypeString
private java.lang.String getTypeString(int type) throws HeapDumpException
- Throws:
HeapDumpException
-
read_ID
private long read_ID() throws HeapDumpException
- Throws:
HeapDumpException
-
read_null
byte[] read_null(long len) throws HeapDumpException
- Throws:
HeapDumpException
-
read_contents
byte[] read_contents(long len) throws HeapDumpException
- Throws:
HeapDumpException
-
readNullTerminated
java.lang.String readNullTerminated() throws HeapDumpException
- Throws:
HeapDumpException
-
readString
java.lang.String readString(long len) throws HeapDumpException
- Throws:
HeapDumpException
-
read_U8
long read_U8() throws HeapDumpException
- Throws:
HeapDumpException
-
read_U4
long read_U4() throws HeapDumpException
- Throws:
HeapDumpException
-
read_U2
int read_U2() throws HeapDumpException
- Throws:
HeapDumpException
-
read_U1
int read_U1() throws HeapDumpException
- Throws:
HeapDumpException
-
errorMessage
private java.lang.String errorMessage(java.lang.String message) throws HeapDumpException
- Throws:
HeapDumpException
-
visitInstance
protected void visitInstance(long id, long klassID, byte[] bytes)
-
visitClass
protected void visitClass(long id, java.lang.String name, java.util.List<java.lang.Integer> oopIdx, int oopSize)
-
visitPrimArray
protected void visitPrimArray(long id, java.lang.String componentType, int count, byte[] bytes)
-
-