On 2009-12-07 23.48, philippe van dyck wrote:
this is very interesting for me right now.
Infinispan cache propose an eviction strategy (swap-out cache entries
from memory to the cache store) based on different mechanisms
(FIFO/LRU).
The issue here is the triggering system, it is based on the number of
entries in the cache... no very effective for me (BTW I wonder if it
is for anyone).
I would like to trigger this using the total size of the cache in
memory (or the free memory left... don't know yet).
If you store the JSON object in the state of composites and you parse
it/update it only "on demand" the actual memory used by this object
will be close to the size of JSON-ized version in the cache.
Is this correct ? Any idea about the best way to calculate the
(average) size of the composite in memory (other than empirically).
That sounds correct. So, basically you would implement a backend for
JSONMapEntityStoreMixin, and then do caching of JSON strings, with the
size of the strings as guideline for when/how to evict. FIFO/LRU could
be used in addition to that.
I would like to avoid eviction as much as possible, so I also plan to
compress the cache content too (gzipping JSON if very effective)...
Yeah, that should work, but I wonder how much CPU will be taken by the
unzip process. Only one way to know...
/Rickard
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev