Class LogarithmicArrayByteBufferPool

  • All Implemented Interfaces:
    ByteBufferPool, Dumpable

    public class LogarithmicArrayByteBufferPool
    extends ArrayByteBufferPool
    Extension of the ArrayByteBufferPool whose bucket sizes increase exponentially instead of linearly. Each bucket will be double the size of the previous bucket, this decreases the amounts of buckets required which can lower total memory usage if buffers are often being acquired of different sizes. However as there are fewer buckets this will also increase the contention on each bucket.
    • Constructor Detail

      • LogarithmicArrayByteBufferPool

        public LogarithmicArrayByteBufferPool()
        Creates a new ByteBufferPool with a default configuration.
      • LogarithmicArrayByteBufferPool

        public LogarithmicArrayByteBufferPool​(int minCapacity,
                                              int maxCapacity)
        Creates a new ByteBufferPool with the given configuration.
        Parameters:
        minCapacity - the minimum ByteBuffer capacity
        maxCapacity - the maximum ByteBuffer capacity
      • LogarithmicArrayByteBufferPool

        public LogarithmicArrayByteBufferPool​(int minCapacity,
                                              int maxCapacity,
                                              int maxQueueLength)
        Creates a new ByteBufferPool with the given configuration.
        Parameters:
        minCapacity - the minimum ByteBuffer capacity
        maxCapacity - the maximum ByteBuffer capacity
        maxQueueLength - the maximum ByteBuffer queue length
      • LogarithmicArrayByteBufferPool

        public LogarithmicArrayByteBufferPool​(int minCapacity,
                                              int maxCapacity,
                                              int maxQueueLength,
                                              long maxHeapMemory,
                                              long maxDirectMemory)
        Creates a new ByteBufferPool with the given configuration.
        Parameters:
        minCapacity - the minimum ByteBuffer capacity
        maxCapacity - the maximum ByteBuffer capacity
        maxQueueLength - the maximum ByteBuffer queue length
        maxHeapMemory - the max heap memory in bytes
        maxDirectMemory - the max direct memory in bytes