Skip to content
🤔 Documentation issue? Report it

//leakcanary-repo/shark/HeapValue

HeapValue

[jvm]\ class HeapValue(val graph: HeapGraph, val holder: ValueHolder)

Represents a value in the heap dump, which can be an object reference or a primitive type.

Constructors

HeapValue [jvm]
constructor(graph: HeapGraph, holder: ValueHolder)

Functions

Name Summary
heapValueAsString [jvm]
fun HeapValue.heapValueAsString(): String
readAsJavaString [jvm]
fun readAsJavaString(): String?
If this HeapValue if it represents a non null object reference to an instance of the String class that exists in the heap dump, returns a String instance with content that matches the string in the heap dump. Otherwise returns null.

Properties

Name Summary
asBoolean [jvm]
val asBoolean: Boolean?
This HeapValue as a Boolean if it represents one, or null otherwise.
asByte [jvm]
val asByte: Byte?
This HeapValue as a Byte if it represents one, or null otherwise.
asChar [jvm]
val asChar: Char?
This HeapValue as a Char if it represents one, or null otherwise.
asDouble [jvm]
val asDouble: Double?
This HeapValue as a Double if it represents one, or null otherwise.
asFloat [jvm]
val asFloat: Float?
This HeapValue as a Float if it represents one, or null otherwise.
asInt [jvm]
val asInt: Int?
This HeapValue as an Int if it represents one, or null otherwise.
asLong [jvm]
val asLong: Long?
This HeapValue as a Long if it represents one, or null otherwise.
asNonNullObjectId [jvm]
val asNonNullObjectId: Long?
This HeapValue as a Long if it represents a non null object reference, or null otherwise.
asObject [jvm]
val asObject: HeapObject?
The HeapObject referenced by this HeapValue if it represents a non null object reference, or null otherwise.
asObjectId [jvm]
val asObjectId: Long?
This HeapValue as a Long if it represents an object reference, or null otherwise.
asShort [jvm]
val asShort: Short?
This HeapValue as a Short if it represents one, or null otherwise.
graph [jvm]
val graph: HeapGraph
The graph of objects in the heap, which you can use to navigate the heap.
holder [jvm]
val holder: ValueHolder
Holds the actual value that this HeapValue represents.
isNonNullReference [jvm]
val isNonNullReference: Boolean
True is this HeapValue represents a non null object reference, false otherwise.
isNullReference [jvm]
val isNullReference: Boolean
True is this HeapValue represents a null object reference, false otherwise.