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) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()protected voiddecrementMemory(ByteBuffer buffer) protected intlonglongprotected intlonggetMemory(boolean direct) protected voidincrementMemory(ByteBuffer buffer) protected voidreleaseExcessMemory(boolean direct, Consumer<Boolean> clearFn) 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 -
_heapMemory
-
_maxDirectMemory
private final long _maxDirectMemory -
_directMemory
-
-
Constructor Details
-
AbstractByteBufferPool
protected AbstractByteBufferPool(int factor, int maxQueueLength, long maxHeapMemory, long maxDirectMemory)
-
-
Method Details
-
getCapacityFactor
protected int getCapacityFactor() -
getMaxQueueLength
protected int getMaxQueueLength() -
decrementMemory
-
incrementMemory
-
updateMemory
-
releaseExcessMemory
-
getDirectMemory
-
getHeapMemory
-
getMemory
public long getMemory(boolean direct) -
clear
-