//leakcanary-object-watcher/leakcanary

Package leakcanary

Types

NameSummary
Clock[jvm]
fun interface Clock
An interface to abstract the SystemClock.uptimeMillis() Android API in non Android artifacts.
GcTrigger[jvm]
fun interface GcTrigger
GcTrigger is used to try triggering garbage collection and enqueuing KeyedWeakReference into the associated java.lang.ref.ReferenceQueue. The default implementation Default comes from AOSP.
KeyedWeakReference[jvm]
class KeyedWeakReference(referent: Any, key: String, description: String, 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.
ObjectWatcher[jvm]
class ObjectWatcher(clock: Clock, checkRetainedExecutor: Executor, isEnabled: () -> Boolean) : ReachabilityWatcher
ObjectWatcher can be passed objects to watch. It will create KeyedWeakReference instances that reference watches objects, and check if those references have been cleared as expected on the checkRetainedExecutor executor. If not, these objects are considered retained and ObjectWatcher will then notify registered OnObjectRetainedListeners on that executor thread.
OnObjectRetainedListener[jvm]
fun interface OnObjectRetainedListener
Listener used by ObjectWatcher to report retained objects.
ReachabilityWatcher[jvm]
fun interface ReachabilityWatcher