java.lang.Object
stormpot.internal.PreciseLeakDetector
Leak detector, used to detect if objects allocated by the pool get garbage collected,
without first being deallocated by the pool.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongCompute a count of the leaked objects that this detector has detected.voidRegister the given slot and its contained object with the detector.voidunregister(BSlot<?> slot) Deregister the given slot from the leak detector.
-
Constructor Details
-
PreciseLeakDetector
public PreciseLeakDetector()Create a new instance.
-
-
Method Details
-
register
Register the given slot and its contained object with the detector.The slot has had an object allocated to it, and is about to be handed over to user code.
- Parameters:
slot- The slot to register.
-
unregister
Deregister the given slot from the leak detector.The object held by the slot has been deallocated by the pool.
- Parameters:
slot- The slot to deregister.
-
countLeakedObjects
public long countLeakedObjects()Compute a count of the leaked objects that this detector has detected.- Returns:
- The number of object leaks observed.
-