This class implements a memory-managed hashtable wrapper that uses
a weighted mix of LRU and LFU to keep track of object importance.
NOTE: this class is _HIGHLY_ un-optimized and this class is _CRITICAL_
for a fast performance of the whole system. So, if you find any better
way to implement this class (clever data models, smart update algorithms,
etc...), please, consider patching this implementation or
sending a note about a method to do it.
Background memory check.
Checks that memory is not running too low in the JVM because of the Store.
It will try to keep overall memory usage below the requested levels.
Specified by:
run in interface java.lang.Runnable
memoryLow
public boolean memoryLow()
store
public void store(java.lang.Object key,
java.lang.Object value)
Store the given object in a persistent state. It is up to the
caller to ensure that the key has a persistent state across
different JVM executions.
public void hold(java.lang.Object key,
java.lang.Object object)
Holds the given object in a volatile state. This means
the object store will discard held objects if the
virtual machine is restarted or some error happens.