java.lang.Object
org.eclipse.jetty.io.ArrayByteBufferPool
org.eclipse.jetty.io.ArrayByteBufferPool.Quadratic
- All Implemented Interfaces:
ByteBufferPool,org.eclipse.jetty.util.component.Dumpable
- Enclosing class:
ArrayByteBufferPool
A variant of the
ArrayByteBufferPool that
uses buckets of buffers that increase in size by a power of
2 (e.g. 1k, 2k, 4k, 8k, etc.).-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.io.ArrayByteBufferPool
ArrayByteBufferPool.Quadratic, ArrayByteBufferPool.Tracking, ArrayByteBufferPool.WithBucketCapacitiesNested classes/interfaces inherited from interface org.eclipse.jetty.io.ByteBufferPool
ByteBufferPool.Accumulator, ByteBufferPool.NonPooling, ByteBufferPool.Sized, ByteBufferPool.WrapperNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainer -
Field Summary
Fields inherited from interface org.eclipse.jetty.io.ByteBufferPool
NON_POOLING, SIZED_NON_POOLINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
ConstructorsConstructorDescriptionCreates a pool with buckets starting at 1 KiB up to 64 KiB.Quadratic(int minCapacity, int maxCapacity, int maxBucketSize) Creates a pool with the specifiedminCapacity,maxCapacityandmaxBucketSize, seeQuadratic(int, int, int, long, long).Quadratic(int minCapacity, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory) Creates a pool with buckets starting at the closest power of 2 larger thanminCapacity, up to the closest power of 2 larger thanmaxCapacity. -
Method Summary
Methods inherited from class org.eclipse.jetty.io.ArrayByteBufferPool
acquire, clear, dump, getAvailableDirectByteBufferCount, getAvailableDirectMemory, getAvailableHeapByteBufferCount, getAvailableHeapMemory, getDirectBucketsStatistics, getDirectByteBufferCount, getDirectMemory, getHeapBucketsStatistics, getHeapByteBufferCount, getHeapMemory, getMaxCapacity, getMinCapacity, getNoBucketDirectAcquires, getNoBucketHeapAcquires, getReserved, isStatisticsEnabled, poolFor, setStatisticsEnabled, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dump, dumpSelf
-
Constructor Details
-
Quadratic
public Quadratic()Creates a pool with buckets starting at 1 KiB up to 64 KiB. -
Quadratic
public Quadratic(int minCapacity, int maxCapacity, int maxBucketSize) Creates a pool with the specified
minCapacity,maxCapacityandmaxBucketSize, seeQuadratic(int, int, int, long, long).- Parameters:
minCapacity- the capacity under which buffers will not be pooledmaxCapacity- the capacity above which buffers will not be pooledmaxBucketSize- the max number of buffers in a bucket
-
Quadratic
public Quadratic(int minCapacity, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory) Creates a pool with buckets starting at the closest power of 2 larger than
minCapacity, up to the closest power of 2 larger thanmaxCapacity.For example, with
minCapacity=100andmaxCapacity=800, the buckets will have capacities128, 256, 512, 1024.A non-positive
minCapacityestablishes the first bucket at 1 KiB.A non-positive
maxCapacityestablishes the last bucket at 64 KiB.- Parameters:
minCapacity- the capacity under which buffers will not be pooledmaxCapacity- the capacity above which buffers will not be pooledmaxBucketSize- the max number of buffers in a bucketmaxHeapMemory- the max heap memory in bytes, -1 for unlimited memory or 0 to use default heuristicmaxDirectMemory- the max direct memory in bytes, -1 for unlimited memory or 0 to use default heuristic
-