public static final class MemoryUtils.RetainedDetector
extends java.lang.Object
PhantomReference
.构造器和说明 |
---|
RetainedDetector() |
限定符和类型 | 方法和说明 |
---|---|
void |
assertAllFinalized()
Assert that all tracked elements have been finalized.
|
long |
finalizedCount()
Returns the number of tracked objects that have been finalized.
|
<T> T |
tracked(T object)
Track the object in this
MemoryUtils.RetainedDetector 's ReferenceQueue |
long |
trackedTotal() |
public final <T> T tracked(T object)
MemoryUtils.RetainedDetector
's ReferenceQueue
T
- the type of the objectobject
- the object to trackpublic final long finalizedCount()
public final long trackedTotal()
MemoryUtils.RetainedDetector
public final void assertAllFinalized()
java.lang.AssertionError
- if some tracked elements have not been finalized