shark-graph / shark / HeapObject

HeapObject

sealed class HeapObject

An object in the heap dump.

Types

NameSummary
HeapClassclass HeapClass : HeapObject
A class in the heap dump.
HeapInstanceclass HeapInstance : HeapObject
An instance in the heap dump.
HeapObjectArrayclass HeapObjectArray : HeapObject
An object array in the heap dump.
HeapPrimitiveArrayclass HeapPrimitiveArray : HeapObject
A primitive array in the heap dump.

Properties

NameSummary
asClassval asClass: HeapObject.HeapClass?
This HeapObject as a HeapClass if it is one, or null otherwise
asInstanceval asInstance: HeapObject.HeapInstance?
This HeapObject as a HeapInstance if it is one, or null otherwise
asObjectArrayval asObjectArray: HeapObject.HeapObjectArray?
This HeapObject as a HeapObjectArray if it is one, or null otherwise
asPrimitiveArrayval asPrimitiveArray: HeapObject.HeapPrimitiveArray?
This HeapObject as a HeapPrimitiveArray if it is one, or null otherwise
graphabstract val graph: HeapGraph
The graph of objects in the heap, which you can use to navigate the heap.
objectIdabstract val objectId: Long
The heap identifier of this object.
objectIndexabstract val objectIndex: Int
An positive object index that's specific to how Shark stores objects in memory. The index starts at 0 and ends at HeapGraph.objectCount - 1. There are no gaps, every index value corresponds to an object. Classes are first, then instances, then object arrays then primitive arrays.
recordSizeabstract val recordSize: Int
The total byte size for the record of this object in the heap dump.

Functions

NameSummary
readRecordabstract fun readRecord(): ObjectRecord
Reads and returns the underlying ObjectRecord.

Inheritors

NameSummary
HeapClassclass HeapClass : HeapObject
A class in the heap dump.
HeapInstanceclass HeapInstance : HeapObject
An instance in the heap dump.
HeapObjectArrayclass HeapObjectArray : HeapObject
An object array in the heap dump.
HeapPrimitiveArrayclass HeapPrimitiveArray : HeapObject
A primitive array in the heap dump.