- java.lang.Object
-
- io.netty5.buffer.api.internal.LeakDetection
-
@UnstableApi public final class LeakDetection extends Object
Utility class for the leak detection parts that are static and shared system-wide.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SafeCloseable
onLeakDetected(Consumer<LeakInfo> callback)
Internal API forMemoryManager.onLeakDetected(Consumer)
.static void
reportLeak(LifecycleTracer tracer, String leakedObjectDescription)
Called when a leak is detected.
-
-
-
Method Detail
-
onLeakDetected
public static SafeCloseable onLeakDetected(Consumer<LeakInfo> callback)
Internal API forMemoryManager.onLeakDetected(Consumer)
.- See Also:
MemoryManager.onLeakDetected(Consumer)
-
reportLeak
public static void reportLeak(LifecycleTracer tracer, String leakedObjectDescription)
Called when a leak is detected. This method will inform all registered on-leak-detected callbacks.- Parameters:
tracer
- The life-cycle trace of the leaked object.leakedObjectDescription
- A human-readable description of the leaked object, that can be used for logging.
-
-