Class ArrayByteBufferPool.Tracking

java.lang.Object
org.eclipse.jetty.io.ArrayByteBufferPool
org.eclipse.jetty.io.ArrayByteBufferPool.Tracking
All Implemented Interfaces:
ByteBufferPool, Dumpable
Enclosing class:
ArrayByteBufferPool

public static class ArrayByteBufferPool.Tracking extends ArrayByteBufferPool

A variant of ArrayByteBufferPool that tracks buffer acquires/releases of the retained buffers, useful to identify buffer leaks.

See Also:
  • Field Details

  • Constructor Details

    • Tracking

      public Tracking()
    • Tracking

      public Tracking(int minCapacity, int factor, int maxCapacity)
    • Tracking

      public Tracking(int minCapacity, int factor, int maxCapacity, int maxQueueLength)
    • Tracking

      public Tracking(int minCapacity, int factor, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory)
    • Tracking

      public Tracking(int minCapacity, int factor, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory, long retainedHeapMemory, long retainedDirectMemory)
  • Method Details

    • newRetainableByteBufferPool

      protected RetainableByteBufferPool newRetainableByteBufferPool(int factor, int maxCapacity, int maxBucketSize, long retainedHeapMemory, long retainedDirectMemory)
      Overrides:
      newRetainableByteBufferPool in class ArrayByteBufferPool
    • asRetainableByteBufferPool

      public RetainableByteBufferPool asRetainableByteBufferPool()
      Description copied from interface: ByteBufferPool
      Get this pool as a RetainableByteBufferPool, which supports reference counting of the buffers and possibly a more efficient lookup mechanism based on the Pool class.
      Specified by:
      asRetainableByteBufferPool in interface ByteBufferPool
      Returns:
      This pool as a RetainableByteBufferPool. The same instance is always returned by multiple calls to this method.
    • getCapacityFactor

      protected int getCapacityFactor()
    • getMaxCapacity

      protected int getMaxCapacity()
    • getMaxBucketSize

      protected int getMaxBucketSize()
    • decrementMemory

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

      @Deprecated protected void incrementMemory(ByteBuffer buffer)
      Deprecated.
    • releaseExcessMemory

      protected void releaseExcessMemory(boolean direct, Consumer<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)