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.TrackingNested classes/interfaces inherited from interface org.eclipse.jetty.io.ByteBufferPool
ByteBufferPool.LeaseNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic 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 thePoolclass.protected voiddecrementMemory(ByteBuffer buffer) Deprecated.protected intlonglongprotected intprotected intlonglonglonggetMemory(boolean direct) protected voidincrementMemory(ByteBuffer buffer) Deprecated.protected RetainableByteBufferPoolnewRetainableByteBufferPool(int factor, int maxCapacity, int maxBucketSize, long retainedHeapMemory, long retainedDirectMemory) protected voidreleaseExcessMemory(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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
newRetainableByteBufferPoolin classArrayByteBufferPool
-
asRetainableByteBufferPool
Description copied from interface:ByteBufferPoolGet this pool as aRetainableByteBufferPool, which supports reference counting of the buffers and possibly a more efficient lookup mechanism based on thePoolclass.- Specified by:
asRetainableByteBufferPoolin 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)
-