@ManagedObject abstract class AbstractByteBufferPool extends java.lang.Object implements ByteBufferPool
ByteBufferPool.Bucket, ByteBufferPool.Lease
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.atomic.AtomicLong |
_directMemory |
private int |
_factor |
private java.util.concurrent.atomic.AtomicLong |
_heapMemory |
private long |
_maxDirectMemory |
private long |
_maxHeapMemory |
private int |
_maxQueueLength |
Modifier | Constructor and Description |
---|---|
protected |
AbstractByteBufferPool(int factor,
int maxQueueLength,
long maxHeapMemory,
long maxDirectMemory) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
protected void |
decrementMemory(java.nio.ByteBuffer buffer) |
protected int |
getCapacityFactor() |
long |
getDirectMemory() |
long |
getHeapMemory() |
protected int |
getMaxQueueLength() |
long |
getMemory(boolean direct) |
protected void |
incrementMemory(java.nio.ByteBuffer buffer) |
protected void |
releaseExcessMemory(boolean direct,
java.util.function.Consumer<java.lang.Boolean> clearFn) |
private void |
updateMemory(java.nio.ByteBuffer buffer,
boolean addOrSub) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
acquire, newByteBuffer, release
private final int _factor
private final int _maxQueueLength
private final long _maxHeapMemory
private final java.util.concurrent.atomic.AtomicLong _heapMemory
private final long _maxDirectMemory
private final java.util.concurrent.atomic.AtomicLong _directMemory
protected AbstractByteBufferPool(int factor, int maxQueueLength, long maxHeapMemory, long maxDirectMemory)
protected int getCapacityFactor()
protected int getMaxQueueLength()
protected void decrementMemory(java.nio.ByteBuffer buffer)
protected void incrementMemory(java.nio.ByteBuffer buffer)
private void updateMemory(java.nio.ByteBuffer buffer, boolean addOrSub)
protected void releaseExcessMemory(boolean direct, java.util.function.Consumer<java.lang.Boolean> clearFn)
@ManagedAttribute(value="The bytes retained by direct ByteBuffers") public long getDirectMemory()
@ManagedAttribute(value="The bytes retained by heap ByteBuffers") public long getHeapMemory()
public long getMemory(boolean direct)
@ManagedOperation(value="Clears this ByteBufferPool", impact="ACTION") public void clear()