cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <>
Subject Re: StoreJanitor
Date Thu, 05 Apr 2007 12:54:18 GMT
Reinhard Poetz wrote:
> I wonder what StoreJanitor is good for at all. EHCache takes care that 
> the number of items in the memory cache doesn't grow indefinitly and 
> starts its own cleanup threads for the disc store 
> (

IIUC, EHCache allows you to set only the number of items in cache, and not the 
maximum amount of memory to use, or minimum amount of free memory to leave.

In other words, EHCache leaves you up for guessing what the number should be. It 
should not do this. Maximum number of items in memory should be whatever memory 
can bear, and cache should dump unused memory once free memory goes low.

Granted it can't be implemented cleanly in Java 1.4 (hence thread + interval 
hack) but on Java 1.5 it would work beautifully. All you need is a stinking API 
to clean out entries using LRU algorithm (or whatever is chosen). Or just switch 
to Cocoon's cache in the meantime.

> JCS will probably do the same. I guess that original purpose of 
> StoreJanitor was when Cocoon had its own store implementations 
> (transient, persistent) and we had to take care of cleaning them up in 
> our code.

It still does, and at the moment is easier to live with than EHCache -- as shown 
by Ard in this email.


View raw message