A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
GC problems Ehcache where elements in the cache are eternal
Mr. Vivek Srivastav
Joined: Nov 24, 2006
Aug 13, 2013 12:18:29
I've declared a cache with elements in the cache as eternal & after a fixed interval I overwrite the cache with elements .
so my code looks like ,
Cache mycache = Cache("myCache",int maxElementsInMemory, boolean overflowToDisk, boolean eternal, long timeToLiveSeconds, long timeToIdleSeconds) ; //line 1
where maxElementsInMemory = 10000 , overflowToDisk = false , eternal =true , timeToLiveSeconds =0 , timeToIdleSeconds =0
so say at load time i get some data and add it to cache eg.
Isin isin = new Isin("US38259P5089") ; Element element = new Element(isin , isin ) ; // line 2 mycache.put(element);
And after say 5 mins I again overwrite the data (again with same values hopefully ) .
//After 5 mins Isin isin = new Isin("US38259P5089") ; Element element = new Element(isin , isin ) ; // line 3 mycache.put(element);
So after 5 minutes after the execution of line 3 above does the previous element in the cache (made in line 2 ) get overwritten and so does it get eligible for garbage collection ?
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: GC problems Ehcache where elements in the cache are eternal
[EHCACHE] Problem defaultCache and cache in distributed environment
Renamed "ehcache.xml" to "myehcache.xml" - Cannot find the declaration of element 'ehcache'
What is the proper configuration for OpenJPA using ehcache as a distributed second level cache?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014