Class LeakTrackingByteBufferPool

    • Constructor Detail

      • LeakTrackingByteBufferPool

        public LeakTrackingByteBufferPool​(ByteBufferPool delegate)
    • Method Detail

      • acquire

        public java.nio.ByteBuffer acquire​(int size,
                                           boolean direct)
        Description copied from interface: ByteBufferPool

        Requests a ByteBuffer of the given size.

        The returned buffer may have a bigger capacity than the size being requested but it will have the limit set to the given size.

        Specified by:
        acquire in interface ByteBufferPool
        Parameters:
        size - the size of the buffer
        direct - whether the buffer must be direct or not
        Returns:
        the requested buffer
        See Also:
        ByteBufferPool.release(ByteBuffer)
      • clearTracking

        public void clearTracking()
      • getLeakedAcquires

        public long getLeakedAcquires()
        Returns:
        count of BufferPool.acquire() calls that detected a leak
      • getLeakedReleases

        public long getLeakedReleases()
        Returns:
        count of BufferPool.release() calls that detected a leak
      • getLeakedResources

        public long getLeakedResources()
        Returns:
        count of resources that were acquired but not released