|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.dbi.MemoryBudget
public class MemoryBudget
MemoryBudget calculates the available memory for JE and how to apportion it between cache and log buffers. It is meant to centralize all memory calculations. Objects that ask for memory budgets should get settings from this class, rather than using the configuration parameter values directly.
Nested Class Summary | |
---|---|
static class |
MemoryBudget.Totals
Common base class for shared and private totals. |
Constructor Summary | |
---|---|
MemoryBudget(EnvironmentImpl envImpl,
EnvironmentImpl sharedCacheEnv,
DbConfigManager configManager)
|
Method Summary | |
---|---|
static int |
byteArraySize(int arrayLen)
Returns the memory size occupied by a byte array of a given length. |
void |
envConfigUpdate(DbConfigManager configManager,
EnvironmentMutableConfig ignore)
Respond to config updates. |
long |
getAdminMemoryUsage()
Used for unit testing. |
long |
getBINOverhead()
|
long |
getCacheMemoryUsage()
|
long |
getDBINOverhead()
|
long |
getDINOverhead()
|
long |
getINOverhead()
|
long |
getLockMemoryUsage()
Public for unit testing. |
long |
getLogBufferBudget()
|
long |
getMaxMemory()
|
long |
getMinTreeMemoryUsage()
For unit tests. |
static long |
getRuntimeMaxMemory()
Returns Runtime.maxMemory(), accounting for a MacOS bug. |
MemoryBudget.Totals |
getTotals()
|
long |
getTrackerBudget()
|
long |
getTreeAdminMemoryUsage()
|
long |
getTreeMemoryUsage()
Used for unit testing. |
(package private) long |
getVariableCacheUsage()
|
(package private) void |
initCacheMemoryUsage(long dbTreeAdminMemory)
Initialize the starting environment memory state. |
static int |
intArraySize(int arrayLen)
|
boolean |
isTreeUsageAboveMinimum()
Returns whether eviction of INList information is allowed. |
(package private) StatGroup |
loadStats()
|
static int |
objectArraySize(int arrayLen)
|
(package private) void |
refreshTreeAdminMemoryUsage(long newSize)
Called by INList when clearing tree memory usage. |
(package private) void |
refreshTreeMemoryUsage(long newSize)
Called by INList when recalculating tree memory usage. |
(package private) void |
reset(long newMaxMemory,
boolean newEnv,
DbConfigManager configManager)
Initialize at construction time and when the cache is resized. |
static int |
shortArraySize(int arrayLen)
|
(package private) void |
subtractCacheUsage()
|
String |
toString()
|
static int |
tupleOutputSize(TupleOutput o)
|
void |
updateAdminMemoryUsage(long increment)
Update the environment wide admin memory count, wake up the evictor if necessary. |
void |
updateLockMemoryUsage(long increment,
int lockTableIndex)
|
void |
updateTreeAdminMemoryUsage(long increment)
Update the treeAdmin memory count, wake up the evictor if necessary. |
void |
updateTreeMemoryUsage(long increment)
Update the environment wide tree memory count, wake up the evictor if necessary. |
void |
updateTxnMemoryUsage(long increment)
Update the environment wide txn memory count, wake up the evictor if necessary. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static boolean CLEANUP_DONE
public static boolean DEBUG_ADMIN
public static boolean DEBUG_LOCK
public static boolean DEBUG_TXN
public static boolean DEBUG_TREEADMIN
public static boolean DEBUG_TREE
public static final int LONG_OVERHEAD
public static final int ARRAY_OVERHEAD
public static final int ARRAY_SIZE_INCLUDED
public static final int OBJECT_OVERHEAD
public static final int OBJECT_ARRAY_ITEM_OVERHEAD
public static final int HASHMAP_OVERHEAD
public static final int HASHMAP_ENTRY_OVERHEAD
public static final int HASHSET_OVERHEAD
public static final int HASHSET_ENTRY_OVERHEAD
public static final int TWOHASHMAPS_OVERHEAD
public static final int TREEMAP_OVERHEAD
public static final int TREEMAP_ENTRY_OVERHEAD
public static final int MAPLN_OVERHEAD
public static final int LN_OVERHEAD
public static final int DUPCOUNTLN_OVERHEAD
public static final int BIN_FIXED_OVERHEAD
public static final int NULL_TARGET_ENTRY_OVERHEAD
public static final int SPARSE_TARGET_ENTRY_OVERHEAD
public static final int DEFAULT_TARGET_ENTRY_OVERHEAD
public static final int DEFAULT_KEYVALS_OVERHEAD
public static final int MAX_KEY_SIZE_KEYVALS_OVERHEAD
public static final int DIN_FIXED_OVERHEAD
public static final int DBIN_FIXED_OVERHEAD
public static final int IN_FIXED_OVERHEAD
public static final int KEY_OVERHEAD
public static final int LOCKIMPL_OVERHEAD
public static final int THINLOCKIMPL_OVERHEAD
public static final int LOCKINFO_OVERHEAD
public static final int WRITE_LOCKINFO_OVERHEAD
public static final int TXN_OVERHEAD
public static final int CHECKPOINT_REFERENCE_SIZE
public static final int UTILIZATION_PROFILE_ENTRY
public static final int DBFILESUMMARY_OVERHEAD
public static final int TFS_LIST_INITIAL_OVERHEAD
public static final int TFS_LIST_SEGMENT_OVERHEAD
public static final int LN_INFO_OVERHEAD
public static final int FILESUMMARYLN_OVERHEAD
public static final int LONG_LIST_PER_ITEM_OVERHEAD
public static final int TUPLE_OUTPUT_OVERHEAD
public static final int PRIMITIVE_LONG_ARRAY_ITEM_OVERHEAD
public static final long MIN_MAX_MEMORY_SIZE
public static final String MIN_MAX_MEMORY_SIZE_STRING
Constructor Detail |
---|
MemoryBudget(EnvironmentImpl envImpl, EnvironmentImpl sharedCacheEnv, DbConfigManager configManager) throws DatabaseException
DatabaseException
Method Detail |
---|
public void envConfigUpdate(DbConfigManager configManager, EnvironmentMutableConfig ignore) throws DatabaseException
envConfigUpdate
in interface EnvConfigObserver
DatabaseException
void reset(long newMaxMemory, boolean newEnv, DbConfigManager configManager) throws DatabaseException
newMaxMemory
- is the new total cache budget or is less than 0 if
the total should remain unchanged.newEnv
- is true if this is the first time we are resetting the
budget for a new environment. Note that a new environment has not yet
been added to the set of shared cache environments.
DatabaseException
public static long getRuntimeMaxMemory()
void initCacheMemoryUsage(long dbTreeAdminMemory)
void refreshTreeAdminMemoryUsage(long newSize)
void refreshTreeMemoryUsage(long newSize)
public boolean isTreeUsageAboveMinimum()
public long getMinTreeMemoryUsage()
public void updateTreeMemoryUsage(long increment)
increment
- note that increment may be negative.public void updateTxnMemoryUsage(long increment)
increment
- note that increment may be negative.public void updateAdminMemoryUsage(long increment)
increment
- note that increment may be negative.public void updateTreeAdminMemoryUsage(long increment)
increment
- note that increment may be negative.public void updateLockMemoryUsage(long increment, int lockTableIndex)
void subtractCacheUsage()
long getVariableCacheUsage()
public long getLockMemoryUsage()
public long getCacheMemoryUsage()
public long getMaxMemory()
public long getTreeMemoryUsage()
public long getAdminMemoryUsage()
public long getTreeAdminMemoryUsage()
public long getLogBufferBudget()
public long getTrackerBudget()
public long getINOverhead()
public long getBINOverhead()
public long getDINOverhead()
public long getDBINOverhead()
public static int tupleOutputSize(TupleOutput o)
public static int byteArraySize(int arrayLen)
public static int shortArraySize(int arrayLen)
public static int intArraySize(int arrayLen)
public static int objectArraySize(int arrayLen)
StatGroup loadStats()
public String toString()
toString
in class Object
public MemoryBudget.Totals getTotals()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |