wood burning stoves 2.0*
The moose likes EhCache and the fly likes EhCache and JCS throws Out of Memory error. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Caching » EhCache
Bookmark "EhCache and JCS throws Out of Memory error." Watch "EhCache and JCS throws Out of Memory error." New topic
Author

EhCache and JCS throws Out of Memory error.

Domendra Markam
Greenhorn

Joined: Feb 15, 2008
Posts: 1
I was trying to evaluate JCS and EhCache . I need to store approx 1 to 2 M instances in the cache. Which can be shared across other JVMs . EhCache throws OutOfMemory error for more than 0.4 M instances. This is the same case with JCS. I have configured disk store for both of them.

Is anyone has faced this issue earlier. I am not sure if there is any limitation on the number of instances. Please suggest?

EhCahce configuration.

<cache name="testCache"
maxElementsInMemory="100"
maxElementsOnDisk="2000000"
eternal="false"
overflowToDisk="true"
diskSpoolBufferSizeMB="20"
diskPersistent="true"
timeToIdleSeconds="300"
timeToLiveSeconds="600"
memoryStoreEvictionPolicy="LFU"
/>

JCS configuration

#jcs.region.testCache1=DC,LTCP
jcs.region.testCache1=DC
jcs.region.testCache1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.region.testCache1.cacheattributes.MaxObjects=100
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=600
jcs.region.testCache1.cacheattributes.MaxSpoolPerRun=500
jcs.region.testCache1.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.region.testCache1.elementattributes.IsEternal=true
jcs.region.testCache1.elementattributes.IsSpool=true
jcs.region.testCache1.elementattributes.DiskUsagePattern=UPDATE



# 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=Data
jcs.auxiliary.DC.attributes.maxKeySize=2000000
jcs.auxiliary.DC.attributes.MaxPurgatorySize=10000
jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000
jcs.auxiliary.DC.attributes.OptimizeOnShutdown=true
jcs.auxiliary.DC.attributes.MaxRecycleBinSize=7500
jcs.auxiliary.DC.attributes.EventQueueType=POOLED
jcs.auxiliary.DC.attributes.EventQueuePoolName=disk_cache_event_queue


# Disk Cache pool
thread_pool.disk_cache_event_queue.boundarySize=50
thread_pool.disk_cache_event_queue.useBoundary=true
thread_pool.disk_cache_event_queue.maximumPoolSize=15
thread_pool.disk_cache_event_queue.minimumPoolSize=1
thread_pool.disk_cache_event_queue.keepAliveTime=3500
thread_pool.disk_cache_event_queue.startUpSize=1
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: EhCache and JCS throws Out of Memory error.