KeyedWeakReference

class KeyedWeakReference(    referent: Any,     val key: String,     val description: String,     val watchUptimeMillis: Long,     referenceQueue: ReferenceQueue<Any>) : WeakReference<Any>

A weak reference used by ObjectWatcher to determine which objects become weakly reachable and which don't. ObjectWatcher uses key to keep track of KeyedWeakReference instances that haven't made it into the associated ReferenceQueue yet.

heapDumpUptimeMillis should be set with the current time from Clock.uptimeMillis right before dumping the heap, so that we can later determine how long an object was retained.

Constructors

Link copied to clipboard
fun KeyedWeakReference(    referent: Any,     key: String,     description: String,     watchUptimeMillis: Long,     referenceQueue: ReferenceQueue<Any>)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun clear()
Link copied to clipboard
open fun enqueue(): Boolean
Link copied to clipboard
open fun get(): Any?
Link copied to clipboard
open fun isEnqueued(): Boolean

Properties

Link copied to clipboard
val description: String
Link copied to clipboard
val key: String
Link copied to clipboard
val next: Reference<Any>
Link copied to clipboard
val queue: ReferenceQueue<in Any>
Link copied to clipboard
var retainedUptimeMillis: Long

Time at which the associated object (referent) was considered retained, or -1 if it hasn't been yet.

Link copied to clipboard
val watchUptimeMillis: Long