Skip to content
🤔 Documentation issue? Report it

//leakcanary-repo/leakcanary/RetainedObjectTracker

RetainedObjectTracker

interface RetainedObjectTracker

Helper util for tracking retained objects.

A retained object is an object that is expected to be deleted but stays strongly reachable, preventing it from being garbage collected.

Inheritors

ReferenceQueueRetainedObjectTracker

Functions

Name Summary
clearAllObjectsTracked [jvm]
abstract fun clearAllObjectsTracked()
Clears weak reachability expectations for all tracked objects.
clearObjectsTrackedBefore [jvm]
abstract fun clearObjectsTrackedBefore(uptime: Duration)
Clears weak reachability expectations for objects that were created before uptime.

Properties

Name Summary
hasRetainedObjects [jvm]
abstract val hasRetainedObjects: Boolean
Returns true if any of the tracked objects are currently retained.
hasTrackedObjects [jvm]
abstract val hasTrackedObjects: Boolean
Returns true if there are any tracked objects that aren’t currently weakly reachable.
retainedObjectCount [jvm]
abstract val retainedObjectCount: Int
Returns the number of retained objects.
trackedObjectCount [jvm]
abstract val trackedObjectCount: Int
Returns the number of tracked objects that aren’t weakly reachable.