|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.storage.DefaultCacheManager
public class DefaultCacheManager
CacheManager maintains a global memory pool available to all page caches. All caches start with a low default setting, but CacheManager can grow individual caches until the total memory is reached. Caches can also be shrinked if their "load" remains below a given threshold between check intervals.The check interval is determined by the global sync background thread. The class computes the available memory in terms of pages.
Field Summary | |
---|---|
static String |
CACHE_SIZE_ATTRIBUTE
|
static int |
DEFAULT_CACHE_SIZE
|
static double |
MAX_MEM_USE
The maximum fraction of the total memory that can be used by a single cache. |
static double |
MIN_SHRINK_FACTOR
The minimum size a cache needs to have to be considered for shrinking, defined in terms of a fraction of the overall memory. |
static String |
PROPERTY_CACHE_SIZE
|
static double |
SHRINK_FACTOR
The amount by which a large cache will be shrinked if other caches request a resize. |
static int |
SHRINK_THRESHOLD
The minimum number of pages that must be read from a cache between check intervals to be not considered for shrinking. |
Fields inherited from interface org.exist.storage.CacheManager |
---|
BTREE_CACHE, DATA_CACHE |
Constructor Summary | |
---|---|
DefaultCacheManager(BrokerPool pool)
|
Method Summary | |
---|---|
void |
checkCaches()
Called from the global major sync event to check if caches can be shrinked. |
void |
checkDistribution()
Called from the global minor sync event to check if a smaller cache wants to be resized. |
void |
deregisterCache(Cache cache)
|
long |
getCurrentSize()
|
int |
getDefaultInitialSize()
Returns the default initial size for all caches. |
long |
getMaxSingle()
|
long |
getMaxTotal()
|
long |
getSizeInBytes()
|
long |
getTotalMem()
|
void |
registerCache(Cache cache)
Register a cache, i.e. |
int |
requestMem(Cache cache)
Called by a cache if it wants to grow. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double MAX_MEM_USE
public static final double MIN_SHRINK_FACTOR
public static final double SHRINK_FACTOR
public static final int SHRINK_THRESHOLD
public static int DEFAULT_CACHE_SIZE
public static final String CACHE_SIZE_ATTRIBUTE
public static final String PROPERTY_CACHE_SIZE
Constructor Detail |
---|
public DefaultCacheManager(BrokerPool pool)
Method Detail |
---|
public void registerCache(Cache cache)
CacheManager
registerCache
in interface CacheManager
public void deregisterCache(Cache cache)
deregisterCache
in interface CacheManager
public int requestMem(Cache cache)
CacheManager
Cache.resize(int)
method to resize the cache. The amount
of pages by which the cache will grow is determined by the cache's
growthFactor: Cache.getGrowthFactor()
.
requestMem
in interface CacheManager
public void checkCaches()
MIN_SHRINK_FACTOR
and its load needs to be lower than SHRINK_THRESHOLD
.
If shrinked, the cache will be reset to the default initial cache size.
checkCaches
in interface CacheManager
public void checkDistribution()
CacheManager
checkDistribution
in interface CacheManager
public long getMaxTotal()
getMaxTotal
in interface CacheManager
public long getCurrentSize()
getCurrentSize
in interface CacheManager
public long getSizeInBytes()
public long getMaxSingle()
getMaxSingle
in interface CacheManager
public long getTotalMem()
public int getDefaultInitialSize()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |