cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: Local Query Cache Problems
Date Thu, 12 Apr 2018 05:20:35 GMT
Yeah, LRU caches are prone to individual cache entry size fluctuations. With large active caches
this averages out (more or less), but is still an issue.

Somehow I overlooked Caffeine. Looks interesting. Let me try to switch a few projects.


> On Apr 12, 2018, at 6:45 AM, Aristedes Maniatis <> wrote:
> On 11/4/18 11:28pm, Andrus Adamchik wrote:
>> Also EhCache may actively remove expired items (?), but OSCache certainly did not,
and it was not a problem either, also because of maxsize/LRU.
> Actually that's a problem in EHcache that had us leave it and use Caffeine instead. EHCache
only tries to clean up memory when you write a new item to the cache and it is hardcoded to
try and evict two items for every new item you add.
> This is a real problem if you try to add a new 100Mb query result and it happens to try
to evict two 1kB queries already in the cache. Boom, your app runs out of memory and dies.
The response from the EHCache people was that it works best when all items our roughly the
same size. Unfortunately the Cayenne query cache can easily add items with hugely different
> We found that caffeine gives us a little more control over this process (
) and it is still a trivial replacement since it implements jCache.
> Caching is definitely not one of those "click this box to make everything faster" and
forget about it things.
> Oh, hi everyone. I know I've been absent for a while... my life has been a little crazy.
> Ari

View raw message