Package org.eclipse.jetty.io
Class ArrayByteBufferPool.Tracking
java.lang.Object
org.eclipse.jetty.io.ArrayByteBufferPool
org.eclipse.jetty.io.ArrayByteBufferPool.Tracking
- All Implemented Interfaces:
ByteBufferPool
,Dumpable
- Enclosing class:
- ArrayByteBufferPool
A variant of ArrayByteBufferPool
that tracks buffer
acquires/releases of the retained buffers, useful to identify buffer leaks.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.io.ArrayByteBufferPool
ArrayByteBufferPool.Retained, ArrayByteBufferPool.Tracking
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.ByteBufferPool
ByteBufferPool.Lease
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionTracking()
Tracking
(int minCapacity, int factor, int maxCapacity) Tracking
(int minCapacity, int factor, int maxCapacity, int maxQueueLength) Tracking
(int minCapacity, int factor, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory) Tracking
(int minCapacity, int factor, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory, long retainedHeapMemory, long retainedDirectMemory) -
Method Summary
Modifier and TypeMethodDescriptionGet this pool as aRetainableByteBufferPool
, which supports reference counting of the buffers and possibly a more efficient lookup mechanism based on thePool
class.protected void
decrementMemory
(ByteBuffer buffer) Deprecated.protected int
long
long
protected int
protected int
long
long
long
getMemory
(boolean direct) protected void
incrementMemory
(ByteBuffer buffer) Deprecated.protected RetainableByteBufferPool
newRetainableByteBufferPool
(int factor, int maxCapacity, int maxBucketSize, long retainedHeapMemory, long retainedDirectMemory) protected void
releaseExcessMemory
(boolean direct, Consumer<Boolean> clearFn) Methods inherited from class org.eclipse.jetty.io.ArrayByteBufferPool
acquire, bucketFor, bucketFor, capacityFor, clear, dump, getDirectByteBufferCount, getHeapByteBufferCount, isDetailedDump, release, releaseMemory, setDetailedDump, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.io.ByteBufferPool
newByteBuffer, remove
-
Field Details
-
DEFAULT_FACTOR
public static final int DEFAULT_FACTOR- See Also:
-
DEFAULT_MAX_CAPACITY_BY_FACTOR
public static final int DEFAULT_MAX_CAPACITY_BY_FACTOR- See Also:
-
-
Constructor Details
-
Tracking
public Tracking() -
Tracking
public Tracking(int minCapacity, int factor, int maxCapacity) -
Tracking
public Tracking(int minCapacity, int factor, int maxCapacity, int maxQueueLength) -
Tracking
public Tracking(int minCapacity, int factor, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory) -
Tracking
public Tracking(int minCapacity, int factor, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory, long retainedHeapMemory, long retainedDirectMemory)
-
-
Method Details
-
newRetainableByteBufferPool
protected RetainableByteBufferPool newRetainableByteBufferPool(int factor, int maxCapacity, int maxBucketSize, long retainedHeapMemory, long retainedDirectMemory) - Overrides:
newRetainableByteBufferPool
in classArrayByteBufferPool
-
asRetainableByteBufferPool
Description copied from interface:ByteBufferPool
Get this pool as aRetainableByteBufferPool
, which supports reference counting of the buffers and possibly a more efficient lookup mechanism based on thePool
class.- Specified by:
asRetainableByteBufferPool
in interfaceByteBufferPool
- Returns:
- This pool as a RetainableByteBufferPool. The same instance is always returned by multiple calls to this method.
-
getCapacityFactor
protected int getCapacityFactor() -
getMaxCapacity
protected int getMaxCapacity() -
getMaxBucketSize
protected int getMaxBucketSize() -
decrementMemory
Deprecated. -
incrementMemory
Deprecated. -
releaseExcessMemory
-
getDirectMemory
-
getHeapMemory
-
getMaxDirectMemory
@ManagedAttribute("The max num of bytes that can be retained from direct ByteBuffers") public long getMaxDirectMemory() -
getMaxHeapMemory
@ManagedAttribute("The max num of bytes that can be retained from heap ByteBuffers") public long getMaxHeapMemory() -
getMemory
public long getMemory(boolean direct)
-