On 20 Jun 2010, at 04:28, kapil nayar wrote:
Hi Manik,
The purpose is the usual that the application would want to take some action on expiry of
the entry. Ofcourse the application can also start a timer in parallel but those timers
may again need to be synced up in case of distributed apps.
However, your explanation brings out another question - is there an additional overhead
(memory related) using expiry on the cache entries as compared to keeping an active
control over the cache entry creation and deletion. An application using only cache
entries with expiry.
Yes there is an overhead, since timestamps and lifespans are attached to each and every
entry. These are longs, so 8 bytes each. An extra 16 bytes per entry. If you don't
use expiry, Infinispan uses a different Entry implementation class which does not have
this overhead.
Cheers
Manik
--
Manik Surtani
manik(a)jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org