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

Functions

Link copied to clipboard
abstract fun clearAllObjectsTracked()

Clears weak reachability expectations for all tracked objects.

Link copied to clipboard
abstract fun clearObjectsTrackedBefore(uptime: Duration)

Clears weak reachability expectations for objects that were created before uptime.

Properties

Link copied to clipboard

Returns true if any of the tracked objects are currently retained.

Link copied to clipboard

Returns true if there are any tracked objects that aren't currently weakly reachable.

Link copied to clipboard
abstract val retainedObjectCount: Int

Returns the number of retained objects.

Link copied to clipboard
abstract val trackedObjectCount: Int

Returns the number of tracked objects that aren't weakly reachable.