Package org.eclipse.jetty.io
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
A variant of ArrayByteBufferPool
that tracks buffer
acquires/releases, useful to identify buffer leaks.
Use getLeaks()
when the system is idle to get
the ArrayByteBufferPool.Tracking.Buffer
s that have been leaked, which contain
the stack trace information of where the buffer was acquired.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.io.ArrayByteBufferPool
ArrayByteBufferPool.Quadratic, ArrayByteBufferPool.Tracking
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.ByteBufferPool
ByteBufferPool.Accumulator, ByteBufferPool.NonPooling, ByteBufferPool.Sized, ByteBufferPool.Wrapper
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Field Summary
Fields inherited from interface org.eclipse.jetty.io.ByteBufferPool
NON_POOLING, SIZED_NON_POOLING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionacquire
(int size, boolean direct) Acquires aRetainableByteBuffer
from this pool.getLeaks()
Methods inherited from class org.eclipse.jetty.io.ArrayByteBufferPool
clear, dump, getAvailableDirectByteBufferCount, getAvailableDirectMemory, getAvailableHeapByteBufferCount, getAvailableHeapMemory, getDirectByteBufferCount, getDirectMemory, getHeapByteBufferCount, getHeapMemory, getMaxCapacity, getMinCapacity, isStatisticsEnabled, poolFor, removeAndRelease, setStatisticsEnabled, toString
-
Constructor Details
-
Tracking
public Tracking() -
Tracking
public Tracking(int minCapacity, int maxCapacity, int maxBucketSize) -
Tracking
public Tracking(int minCapacity, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory)
-
-
Method Details
-
acquire
Description copied from interface:ByteBufferPool
Acquires a
RetainableByteBuffer
from this pool.- Specified by:
acquire
in interfaceByteBufferPool
- Overrides:
acquire
in classArrayByteBufferPool
- Parameters:
size
- The size of the buffer. The returned buffer will have at least this capacity.direct
- true if a direct memory buffer is needed, false otherwise.- Returns:
- a
RetainableByteBuffer
with position and limit set to 0.
-
getLeaks
-
dumpLeaks
-