Skip to content
🤔 Documentation issue? Report it

//leakcanary-repo/shark/HprofRecordReader

HprofRecordReader

[jvm]\ class HprofRecordReader

Reads hprof content from an Okio BufferedSource.

Binary Dump Format reference: http://hg.openjdk.java.net/jdk6/jdk6/jdk/raw-file/tip/src/share /demo/jvmti/hprof/manual.html#mozTocId848088

The Android Hprof format differs in some ways from that reference. This parser implementation is largely adapted from https://android.googlesource.com/platform/tools/base/+/studio-master-dev /perflib/src/main/java/com/android/tools/perflib

Not thread safe, should be used from a single thread.

Types

Name Summary
Companion [jvm]
object Companion

Functions

Name Summary
readBoolean [jvm]
fun readBoolean(): Boolean
readBooleanArray [jvm]
fun readBooleanArray(arrayLength: Int): BooleanArray
readByte [jvm]
fun readByte(): Byte
readByteArray [jvm]
fun readByteArray(byteCount: Int): ByteArray
readChar [jvm]
fun readChar(): Char
readCharArray [jvm]
fun readCharArray(arrayLength: Int): CharArray
readClassDumpRecord [jvm]
fun readClassDumpRecord(): HprofRecord.HeapDumpRecord.ObjectRecord.ClassDumpRecord
Reads a full class record after a class dump tag.
readDebuggerGcRootRecord [jvm]
fun readDebuggerGcRootRecord(): GcRoot.Debugger
readDouble [jvm]
fun readDouble(): Double
readDoubleArray [jvm]
fun readDoubleArray(arrayLength: Int): DoubleArray
readFinalizingGcRootRecord [jvm]
fun readFinalizingGcRootRecord(): GcRoot.Finalizing
readFloat [jvm]
fun readFloat(): Float
readFloatArray [jvm]
fun readFloatArray(arrayLength: Int): FloatArray
readHeapDumpInfoRecord [jvm]
fun readHeapDumpInfoRecord(): HprofRecord.HeapDumpRecord.HeapDumpInfoRecord
readId [jvm]
fun readId(): Long
readIdArray [jvm]
fun readIdArray(arrayLength: Int): LongArray
readInstanceDumpRecord [jvm]
fun readInstanceDumpRecord(): HprofRecord.HeapDumpRecord.ObjectRecord.InstanceDumpRecord
Reads a full instance record after a instance dump tag.
readInt [jvm]
fun readInt(): Int
readIntArray [jvm]
fun readIntArray(arrayLength: Int): IntArray
readInternedStringGcRootRecord [jvm]
fun readInternedStringGcRootRecord(): GcRoot.InternedString
readJavaFrameGcRootRecord [jvm]
fun readJavaFrameGcRootRecord(): GcRoot.JavaFrame
readJniGlobalGcRootRecord [jvm]
fun readJniGlobalGcRootRecord(): GcRoot.JniGlobal
readJniLocalGcRootRecord [jvm]
fun readJniLocalGcRootRecord(): GcRoot.JniLocal
readJniMonitorGcRootRecord [jvm]
fun readJniMonitorGcRootRecord(): GcRoot.JniMonitor
readLoadClassRecord [jvm]
fun readLoadClassRecord(): HprofRecord.LoadClassRecord
readLong [jvm]
fun readLong(): Long
readLongArray [jvm]
fun readLongArray(arrayLength: Int): LongArray
readMonitorUsedGcRootRecord [jvm]
fun readMonitorUsedGcRootRecord(): GcRoot.MonitorUsed
readNativeStackGcRootRecord [jvm]
fun readNativeStackGcRootRecord(): GcRoot.NativeStack
readObjectArrayDumpRecord [jvm]
fun readObjectArrayDumpRecord(): HprofRecord.HeapDumpRecord.ObjectRecord.ObjectArrayDumpRecord
Reads a full object array record after a object array dump tag.
readPrimitiveArrayDumpRecord [jvm]
fun readPrimitiveArrayDumpRecord(): HprofRecord.HeapDumpRecord.ObjectRecord.PrimitiveArrayDumpRecord
Reads a full primitive array record after a primitive array dump tag.
readReferenceCleanupGcRootRecord [jvm]
fun readReferenceCleanupGcRootRecord(): GcRoot.ReferenceCleanup
readShort [jvm]
fun readShort(): Short
readShortArray [jvm]
fun readShortArray(arrayLength: Int): ShortArray
readStackFrameRecord [jvm]
fun readStackFrameRecord(): HprofRecord.StackFrameRecord
readStackTraceRecord [jvm]
fun readStackTraceRecord(): HprofRecord.StackTraceRecord
readStickyClassGcRootRecord [jvm]
fun readStickyClassGcRootRecord(): GcRoot.StickyClass
readString [jvm]
fun readString(byteCount: Int, charset: Charset): String
readStringRecord [jvm]
fun readStringRecord(length: Long): HprofRecord.StringRecord
readThreadBlockGcRootRecord [jvm]
fun readThreadBlockGcRootRecord(): GcRoot.ThreadBlock
readThreadObjectGcRootRecord [jvm]
fun readThreadObjectGcRootRecord(): GcRoot.ThreadObject
readUnknownGcRootRecord [jvm]
fun readUnknownGcRootRecord(): GcRoot.Unknown
readUnreachableGcRootRecord [jvm]
fun readUnreachableGcRootRecord(): GcRoot.Unreachable
readUnsignedByte [jvm]
fun readUnsignedByte(): Int
readUnsignedInt [jvm]
fun readUnsignedInt(): Long
readUnsignedShort [jvm]
fun readUnsignedShort(): Int
readUtf8 [jvm]
fun readUtf8(byteCount: Long): String
readValue [jvm]
fun readValue(type: Int): ValueHolder
Reads a value in the heap dump, which can be a reference or a primitive type.
readVmInternalGcRootRecord [jvm]
fun readVmInternalGcRootRecord(): GcRoot.VmInternal
sizeOf [jvm]
fun sizeOf(type: Int): Int
skip [jvm]
fun skip(byteCount: Int)
fun skip(byteCount: Long)
skipClassDumpConstantPool [jvm]
fun skipClassDumpConstantPool()
skipClassDumpFields [jvm]
fun skipClassDumpFields()
skipClassDumpHeader [jvm]
fun skipClassDumpHeader()
skipClassDumpRecord [jvm]
fun skipClassDumpRecord()
skipClassDumpStaticFields [jvm]
fun skipClassDumpStaticFields()
skipHeapDumpInfoRecord [jvm]
fun skipHeapDumpInfoRecord()
skipId [jvm]
fun skipId()
skipInstanceDumpRecord [jvm]
fun skipInstanceDumpRecord()
skipObjectArrayDumpRecord [jvm]
fun skipObjectArrayDumpRecord()
skipPrimitiveArrayDumpRecord [jvm]
fun skipPrimitiveArrayDumpRecord()

Properties

Name Summary
bytesRead [jvm]
var bytesRead: Long
How many bytes this reader has read from source. Can only increase.