Try to put some delay before adding elements to the cache.
For my unit test, the memory goes stable after it reaches the MaxObjects. 
Theoretically... it should be able to hold unlimited objects. 


> -----Original Message-----
> From: Daniel Rosenbaum [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 09, 2003 6:26 PM
> To: [EMAIL PROTECTED]
> Subject: Memory test
> 
> 
> Hi all,
> 
> I am testing JCS to see how it handles memory.  The following is
> a snippet of my code and config file:
> 
> for(int i=0; i < 200000000; i++) {
>   Vector vec = new Vector();
>   testCache.put("testkey"+i, vec);
> }
> 
> # DEFAULT CACHE REGION (memory cache)
> jcs.default=DC
> jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCac
> heAttributes
> jcs.default.cacheattributes.MaxObjects=2000
> jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.eng
> ine.memory.lru.LRUMemoryCache
> jcs.default.cacheattributes.UseMemoryShrinker=true
> jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
> jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes
> jcs.default.elementattributes.IsEternal=false
> jcs.default.elementattributes.MaxLifeSeconds=43200
> jcs.default.elementattributes.IsSpool=true
> jcs.default.elementattributes.IsRemote=false
> jcs.default.elementattributes.IsLateral=false
> 
> #Auxiliary CACHE (disk cache)
> jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.Indexed
> DiskCacheFactory
> jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.inde
> xed.IndexedDiskCacheAttributes
> jcs.auxiliary.DC.attributes.DiskPath=jcscache
> 
> jcs.region.testCache=DC
> jcs.region.testCache.cacheattributes=org.apache.jcs.engine.Com
> positeCacheAttributes
> jcs.region.testCache.cacheattributes.MaxObjects=50
> jcs.region.testCache.cacheattributes.MemoryCacheName=org.apach
> e.jcs.engine.memory.lru.LRUMemoryCache
> jcs.region.testCache.cacheattributes.UseMemoryShrinker=true
> jcs.region.testCache.cacheattributes.ShrinkerIntervalSeconds=60
> jcs.region.testCache.elementattributes=org.apache.jcs.engine.E
> lementAttributes
> jcs.region.testCache.elementattributes.IsEternal=false
> jcs.region.testCache.elementattributes.MaxLifeSeconds=43200
> jcs.region.testCache.elementattributes.IdleTime=43200
> jcs.region.testCache.elementattributes.IsSpool=true
> jcs.region.testCache.elementattributes.IsRemote=false
> jcs.region.testCache.elementattributes.IsLateral=false
> 
> When I run this code the memory on my system goes down very
> quickly.  I expected that after the first 50 elements it would
> start putting items on disk and removing them from memory but
> this does not seem to be happening.  I see the file on disk
> getting increasingly bigger but memory still keeps going,
> leading me to believe that the elements are not getting garbage
> collected or was never freed.  Am I doing something incorrectly?
> 
> Thanks,
> Daniel
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> For additional commands, e-mail: 
> [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to