public final class RefWatcher
extends java.lang.Object
RefWatcher detects that
a reference might not be weakly reachable when it should, it triggers the HeapDumper.
This class is thread-safe: you can call watch(Object) from any thread.
| Modifier and Type | Field and Description |
|---|---|
static RefWatcher |
DISABLED |
| Constructor and Description |
|---|
RefWatcher(java.util.concurrent.Executor watchExecutor,
DebuggerControl debuggerControl,
GcTrigger gcTrigger,
HeapDumper heapDumper,
HeapDump.Listener heapdumpListener,
ExcludedRefs excludedRefs) |
| Modifier and Type | Method and Description |
|---|---|
void |
watch(java.lang.Object watchedReference)
Identical to
watch(Object, String) with an empty string reference name. |
void |
watch(java.lang.Object watchedReference,
java.lang.String referenceName)
Watches the provided references and checks if it can be GCed.
|
public static final RefWatcher DISABLED
public RefWatcher(java.util.concurrent.Executor watchExecutor,
DebuggerControl debuggerControl,
GcTrigger gcTrigger,
HeapDumper heapDumper,
HeapDump.Listener heapdumpListener,
ExcludedRefs excludedRefs)
public void watch(java.lang.Object watchedReference)
watch(Object, String) with an empty string reference name.watch(Object, String)public void watch(java.lang.Object watchedReference,
java.lang.String referenceName)
Executor this RefWatcher has been constructed with.referenceName - An logical identifier for the watched object.