The maximum number of items allowed in
memory. Eviction of elements in excess of
this number is determined by the memory
cache. By default JCS uses the LRU memory
This property allows you to specify what
memory manager you would like to use. You
can create your own memory manager by
interface. Alternatively, you can extend the
class. Several different memory caches are
available: two LRU implementations, an LFU,
and an adaptive replacement algorithm.
By default, the memory shrinker is shared by
all regions that use the LRU memory cache.
The memory shrinker iterates through the
items in memory, looking for items that have
expired or that have exceeded their max
memory idle time.
This is only used if you are using the
memory shrinker. If this value is set above
-1, then if an item has not been accessed in
this number of seconds, it will be spooled
to disk if the disk is available. You can
register an event handler on this event.
This specifies how often the shrinker should
run, if it has been activated. If you set
UseMemoryShrinker to false, then this
setting has no effect.
SWAP is the default. Under the swap pattern,
data is only put to disk when the max memory
size is reached. Since items puled from disk
are put into memory, if the memory cache is
full and you get an item off disk, the lest
recently used item will be spooled to disk.
If you have a low memory hit ration, you end
The UPDATE usage pattern allows items to go
to disk on an update. It disables the swap.
This allows you to persist all items to
disk. If you are using the JDBC disk cache
for instance, you can put all the items on
disk while using the memory cache for
performance, and not worry about losing
data from a system crash or improper
shutdown. Also, since all items are on disk,
there is no need to swap to disk. This
prevents the possibility of thrashing.