Class AbstractByteBufferPool

    • Field Detail

      • _factor

        private final int _factor
      • _maxQueueLength

        private final int _maxQueueLength
      • _maxHeapMemory

        private final long _maxHeapMemory
      • _maxDirectMemory

        private final long _maxDirectMemory
      • _heapMemory

        private final java.util.concurrent.atomic.AtomicLong _heapMemory
      • _directMemory

        private final java.util.concurrent.atomic.AtomicLong _directMemory
    • Constructor Detail

      • AbstractByteBufferPool

        protected AbstractByteBufferPool​(int factor,
                                         int maxQueueLength,
                                         long maxHeapMemory,
                                         long maxDirectMemory)
        Creates a new ByteBufferPool with the given configuration.
        Parameters:
        factor - the capacity factor
        maxQueueLength - the maximum ByteBuffer queue length
        maxHeapMemory - 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 Detail

      • getCapacityFactor

        protected int getCapacityFactor()
      • getMaxQueueLength

        protected int getMaxQueueLength()
      • decrementMemory

        @Deprecated
        protected void decrementMemory​(java.nio.ByteBuffer buffer)
        Deprecated.
      • incrementMemory

        @Deprecated
        protected void incrementMemory​(java.nio.ByteBuffer buffer)
        Deprecated.
      • updateMemory

        private void updateMemory​(java.nio.ByteBuffer buffer,
                                  boolean addOrSub)
      • releaseExcessMemory

        protected void releaseExcessMemory​(boolean direct,
                                           java.util.function.Consumer<java.lang.Boolean> clearFn)
      • getDirectMemory

        @ManagedAttribute("The bytes retained by direct ByteBuffers")
        public long getDirectMemory()
      • getHeapMemory

        @ManagedAttribute("The bytes retained by heap ByteBuffers")
        public long 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

        java.util.function.IntConsumer updateMemory​(boolean direct)