Well, later on Friday, I fixed the cache keys not being inserted using the following config (mainly settling the MaxObjects = -1 ) . I still have a few issues but let me start by explaining what I'm attempting to achieve.
1. Create a persistant object store on DISK that can be created once and deployed on various machines, .. a database, essentially . The intent is to provide a data mapping that can be readily be used by multiple applications and has good read performance speed. That is why I'm trying to get everything on disk. 2. During application usage, we expect to maintain a reasonable balance between in-memory entries and in-disk entries. 3. we expect a fairly large number of entries (about 500,000 objects) Now for my issues. 1. How does one force everything to disk gracefully. I tried using the dispose method at the end of my insertion routing (see program) and it works okay for smaller sizes but when we get to larger entries, ..it sometimes fails to write and / or sets the index key file to size 0, ..corrupting the entire disk cache. 2. How can I get these many entries to disk. Smaller numbers are fine but once I get above 300K - 400K, I can sometimes get "out of memory .. heap exceptions" . I can tune this out to an extent by introducing a periodic sleep() (currently 10 seconds every 10000 inserts), or possibly increasing the heap size, but wanted to know if there were better methods. Thanks, Vin 2. I can now # DEFAULT CACHE REGION #jcs.default=DC,LTCP jcs.default=DC jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes jcs.default.cacheattributes.MaxObjects=-1 jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache # PRE-DEFINED CACHE REGIONS jcs.region.testCache1=DC jcs.region.testCache1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes jcs.region.testCache1.cacheattributes.MaxObjects=-1 jcs.region.testCache1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache jcs.region.testCache1.cacheattributes.UseMemoryShrinker=true jcs.region.testCache1.cacheattributes.MaxMemoryIdleTimeSeconds=3600 jcs.region.testCache1.cacheattributes.ShrinkerIntervalSeconds=5 jcs.region.testCache1.cacheattributes.MaxSpoolPerRun=500 jcs.region.testCache1.elementattributes=org.apache.jcs.engine.ElementAttributes jcs.region.testCache1.elementattributes.IsEternal=true jcs.region.testCache1.atttributes.maxKeySize=1000000 # AVAILABLE AUXILIARY CACHES jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes jcs.auxiliary.DC.attributes.DiskPath=c:/tmp jcs.auxiliary.DC.attributes.maxKeySize=1000000 jcs.auxiliary.DC.attributes.MaxPurgatorySize=-1