Hi, apologies for the delay.
Re 1: The problem resides in your test. Whenever you call the following code, you're
traversing /user FQN and so it's the same as you were doing
cache.get("/user/1"), cache.get("/user/2"),
cache.get("/user/3"), cache.get("/user/4")...etc. So, 4 and 5 are
always used and since this is the last call of the loop before the sleep, they're the
most LRU and so data added in 3 will be evicted. So, the behaivour you're seeing is
correct.
System.out.println(cache.getChildrenNames("/user/"));
Re 2: The size is exceeded for only a brief period of time. When eviction kicks in,
it's reduced back to 5. Obviously, to see this number exactly, you'd need to print
the contents as soon as the eviction round finished and before you add any new data!
Re 3: Just run your test and verified that eviction gets, first time run in 5 seconds and
afterwards every 10 seconds:
grep -nH -e "EvictionTimerTask" jbosscache.log
| jbosscache.log:242:2009-09-15 18:20:56,127 520 TRACE
[org.jboss.cache.eviction.EvictionTimerTask] (main:) Creating a new eviction listener with
wakeupInterval millis set at 10000
| jbosscache.log:1509:2009-09-15 18:21:01,155 5548 TRACE
[org.jboss.cache.eviction.EvictionTimerTask] (EvictionTimer-0:) Processing eviction
regions [/, /user]
| jbosscache.log:3168:2009-09-15 18:21:11,243 15636 TRACE
[org.jboss.cache.eviction.EvictionTimerTask] (EvictionTimer-0:) Processing eviction
regions [/, /user]
| jbosscache.log:4908:2009-09-15 18:21:21,295 25688 TRACE
[org.jboss.cache.eviction.EvictionTimerTask] (EvictionTimer-0:) Processing eviction
regions [/, /user]
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4255350#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...