ehcache does not remove Element from memory on eviction
http://stackoverflow.com/questions/8838039/ehcache-does-not-remove-element-from-memory-on-eviction
Ehcache will only evict elements when putting elements and your cache is above threshold. Otherwise, accessing those expired elements will result in them being expired (and removed from the Cache). There is no thread that collects and removes expired elements from the Cache in the background. Even though I wouldn't recommend it, as this will affect the Cache's performance (but if memory usage is more important, this might be a fair tradeoff), you can have a background thread doing the getKeysWithExpiryCheck() on a regular interval.
Also if memory consumption is a major point, you might want to look into the new Ehcache 2.5, which lets you (even at the CacheManager level) specify up to how much heap should be used...
'Cache > Ehcache' 카테고리의 다른 글
Expired Element Eviction Timing (0) | 2015.12.02 |
---|---|
Eviction, Expiration (0) | 2015.11.24 |
Using CacheManager (0) | 2015.11.24 |
Gettimg expired cache (0) | 2015.11.24 |
Ehcache (0) | 2015.10.28 |