|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.io.nio.AbstractBufferManager
com.tangosol.io.nio.DirectBufferManager
public class DirectBufferManager
Manages a growable direct ByteBuffer.
ByteBuffer
Field Summary | |
---|---|
static int |
CLEANUP_FINALIZERS Use Runtime.runFinalization() to trigger finalization (default). |
static int |
CLEANUP_GC Use Runtime.gc() to trigger finalization. |
static int |
CLEANUP_NONE Do not perform any buffer cleanup. |
protected static boolean |
MODE_DEBUG Set to true to use on-heap storage, false to use off-heap. |
protected static long |
s_cbUncollected Total amount of memory that have not been collected yet. |
Constructor Summary | |
---|---|
DirectBufferManager(int cbInitial, int cbMaximum) Construct a DirectBufferManager that supports a buffer of a certain initial and maximum size. |
Method Summary | |
---|---|
protected void |
allocateBuffer() Allocate a new buffer, copying old data if there is any. |
protected void |
cleanupBuffers() Determines if and how to induce the JVM to run finalizers. |
static int |
getAllocations() Return the total number of buffers allocated by the DirectBufferManager. |
static int |
getCleanupMethod() Return the method used for buffers cleanup when the threshold is met. |
static float |
getCleanupThreshold() Return the value used to calculate the size threshold for the uncollected buffers that triggers a cleanup operation. |
static long |
getTotalAllocationTime() Return the total time spent allocating buffers, copying the previous content and cleaning up uncollected buffers. |
protected static void |
setCleanupMethod(int nCleanupMethod) Set the method to be used for buffers cleanup when the threshold is met. |
protected static void |
setCleanupThreshold(float flCleanupThreshold) Determines how often, to run the cleanupBuffers() method. |
Methods inherited from class com.tangosol.io.nio.AbstractBufferManager |
---|
calibrate, getBuffer, getCapacity, getGrowthThreshold, getMaxCapacity, getMaxIncrement, getMinCapacity, getShrinkageThreshold, grow, setBuffer, setCapacity, setGrowthThreshold, setMaxCapacity, setMinCapacity, setShrinkageThreshold, shrink |
Field Detail |
---|
public static final int CLEANUP_NONE
public static final int CLEANUP_FINALIZERS
public static final int CLEANUP_GC
protected static final boolean MODE_DEBUG
protected static volatile long s_cbUncollected
Constructor Detail |
---|
public DirectBufferManager(int cbInitial, int cbMaximum)
cbInitial
- the initial sizecbMaximum
- the maximum sizeMethod Detail |
---|
protected void allocateBuffer()
allocateBuffer
in class AbstractBufferManager
ByteBuffer.allocateDirect()
protected void cleanupBuffers()
the cleanup threshold
frequency, induce the GC. In a 64-bit VMs this issue is probably reduced to a minimum.public static long getTotalAllocationTime()
public static int getAllocations()
public static int getCleanupMethod()
The possible return values are:
protected static void setCleanupMethod(int nCleanupMethod)
nCleanupMethod
- a value representing the cleanup method; valid values are the CLEANUP_* constantsjava.lang.IllegalArgumentException
- if passed value is not a valid CLEANUP_* constantpublic static float getCleanupThreshold()
protected static void setCleanupThreshold(float flCleanupThreshold)
cleanupBuffers()
method. Cleanup is performed when the uncollected memory has grown over the product of this value and the maximum Java heap size.flCleanupThreshold
- a value between 0.0 and 1.0 used to calculate the cleanup frequencyjava.lang.IllegalArgumentException
- if the passed value is not valid
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |