watchReference

open override fun watchReference(reference: Any, name: String)

Add reference as a watched instance that is expected to be garbage collected soon.

This function is safe to call from any thread.