Class AbstractByteBufferPool
java.lang.Object
org.eclipse.jetty.io.AbstractByteBufferPool
- All Implemented Interfaces:
ByteBufferPool
- Direct Known Subclasses:
ArrayByteBufferPool, MappedByteBufferPool
-
Nested Class Summary
Nested classes/interfaces inherited from interface ByteBufferPool
ByteBufferPool.Bucket, ByteBufferPool.Lease -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicLongprivate final intprivate final AtomicLongprivate final longprivate final longprivate final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractByteBufferPool(int factor, int maxQueueLength, long maxHeapMemory, long maxDirectMemory) Creates a new ByteBufferPool with the given configuration. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()protected voiddecrementMemory(ByteBuffer buffer) Deprecated.protected intlonglonglonglongprotected intlonggetMemory(boolean direct) protected voidincrementMemory(ByteBuffer buffer) Deprecated.protected voidreleaseExcessMemory(boolean direct, Consumer<Boolean> clearFn) (package private) IntConsumerupdateMemory(boolean direct) private voidupdateMemory(ByteBuffer buffer, boolean addOrSub) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ByteBufferPool
acquire, newByteBuffer, release, remove
-
Field Details
-
_factor
private final int _factor -
_maxQueueLength
private final int _maxQueueLength -
_maxHeapMemory
private final long _maxHeapMemory -
_maxDirectMemory
private final long _maxDirectMemory -
_heapMemory
-
_directMemory
-
-
Constructor Details
-
AbstractByteBufferPool
protected AbstractByteBufferPool(int factor, int maxQueueLength, long maxHeapMemory, long maxDirectMemory) Creates a new ByteBufferPool with the given configuration.- Parameters:
factor- the capacity factormaxQueueLength- the maximum ByteBuffer queue lengthmaxHeapMemory- the max heap memory in bytes, -1 for unlimited memory or 0 to use default heuristic.maxDirectMemory- the max direct memory in bytes, -1 for unlimited memory or 0 to use default heuristic.
-
-
Method Details
-
getCapacityFactor
protected int getCapacityFactor() -
getMaxQueueLength
protected int getMaxQueueLength() -
decrementMemory
Deprecated. -
incrementMemory
Deprecated. -
updateMemory
-
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) -
updateMemory
-
clear
-