Have no time to contribute right now, I really need to clean up the
qi4j store code before anything else...
The design I use is very basic, I hijack the LRU eviction mechanism
and the trigger is memory-size based.
Each time I add or remove anything from the cache, I update the
cache's memory size, that's all.
I don' t even use a separate thread, I check the cache size after each
operation.
I did not test the effect of a transaction rollback or anything complicated.
Regarding infinispan, I think it should be really simple to implement
a callback specifying the metric used to evict.
Right now eviction is triggered by a number of 'entries'. If 'entries'
could be changed to 'megabytes' or '% RAM usage', I don't think there
are a lot of changes to apply to the current code. (well, you still
have to query the host application about the current metric value, but
that should not be infinispan's business since this metric is
hardware/image related).
cheers,
Phil
On Tue, Apr 6, 2010 at 6:57 PM, Manik Surtani <manik(a)jboss.org> wrote:
Size-based eviction is on the roadmap. If you want to contribute
this feature, I'll be happy to talk you though the ideas I had for it ...
On 2 Apr 2010, at 13:19, Philippe Van Dyck wrote:
> Hi all,
>
> looking at LIRS and other strategies, I would like to improve the
> eviction triggering.
> Actually, I would like to be able to trigger eviction when the cache
> eats a specific size or percentage of memory.
> I realize that it could only be used with byte arrays, or any helper
> method allowing us to get the size of a cache entry.
>
> Was this addressed before ?
>
> WDYT ?
>
> phil
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/infinispan-dev
--
Manik Surtani
manik(a)jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org
_______________________________________________
infinispan-dev mailing list
infinispan-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev