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
(http://ehcache.sourceforge.net/documentation/storage_options.html#DiskStore).
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.
Vadim
- Re: StoreJanitor Vadim Gritsenko
-