HeapGraph

interface HeapGraph

Enables navigation through the heap graph of objects.

Functions

findClassByName
Link copied to clipboard
abstract fun findClassByName(className: String): HeapObject.HeapClass?

Returns the HeapClass corresponding to the provided className, or null if the class cannot be found.

findHeapDumpIndex
Link copied to clipboard
abstract fun findHeapDumpIndex(objectId: Long): Int

Returns the 1-based index in the heap dump of the object corresponding to the provided objectId, and throws IllegalArgumentException otherwise.

findObjectByHeapDumpIndex
Link copied to clipboard
abstract fun findObjectByHeapDumpIndex(heapDumpIndex: Int): HeapObject

Returns the HeapObject corresponding to the provided heapDumpIndex, and throws IllegalArgumentException if heapDumpIndex is less than 1 or more than objectCount.

findObjectById
Link copied to clipboard
abstract fun findObjectById(objectId: Long): HeapObject

Returns the HeapObject corresponding to the provided objectId, and throws IllegalArgumentException otherwise.

findObjectByIdOrNull
Link copied to clipboard
abstract fun findObjectByIdOrNull(objectId: Long): HeapObject?

Returns the HeapObject corresponding to the provided objectId or null if it cannot be found.

findObjectByIndex
Link copied to clipboard
abstract fun findObjectByIndex(objectIndex: Int): HeapObject

Returns the HeapObject corresponding to the provided objectIndex, and throws IllegalArgumentException if objectIndex is less than 0 or more than objectCount - 1.

objectExists
Link copied to clipboard
abstract fun objectExists(objectId: Long): Boolean

Returns true if the provided objectId exists in the heap dump.

Properties

classCount
Link copied to clipboard
abstract val classCount: Int
classes
Link copied to clipboard
abstract val classes: Sequence<HeapObject.HeapClass>

Sequence of all classes in the heap dump.

context
Link copied to clipboard
abstract val context: GraphContext

In memory store that can be used to store objects this HeapGraph instance.

gcRoots
Link copied to clipboard
abstract val gcRoots: List<GcRoot>

All GC roots which type matches types known to this heap graph and which point to non null references. You can retrieve the object that a GC Root points to by calling findObjectById with GcRoot.id, however you need to first check that objectExists returns true because GC roots can point to objects that don't exist in the heap dump.

identifierByteSize
Link copied to clipboard
abstract val identifierByteSize: Int
instanceCount
Link copied to clipboard
abstract val instanceCount: Int
instances
Link copied to clipboard
abstract val instances: Sequence<HeapObject.HeapInstance>

Sequence of all instances in the heap dump.

objectArrayCount
Link copied to clipboard
abstract val objectArrayCount: Int
objectArrays
Link copied to clipboard
abstract val objectArrays: Sequence<HeapObject.HeapObjectArray>

Sequence of all object arrays in the heap dump.

objectCount
Link copied to clipboard
abstract val objectCount: Int
objects
Link copied to clipboard
abstract val objects: Sequence<HeapObject>

Sequence of all objects in the heap dump.

primitiveArrayCount
Link copied to clipboard
abstract val primitiveArrayCount: Int
primitiveArrays
Link copied to clipboard
abstract val primitiveArrays: Sequence<HeapObject.HeapPrimitiveArray>

Sequence of all primitive arrays in the heap dump.

Inheritors

CloseableHeapGraph
Link copied to clipboard