[infinispan-issues] [JBoss JIRA] Issue Comment Edited: (ISPN-670) Consider all entries from data container as eviction candidates
Owen Tran (JIRA)
jira-events at lists.jboss.org
Fri Sep 24 17:17:28 EDT 2010
[ https://jira.jboss.org/browse/ISPN-670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12553110#action_12553110 ]
Owen Tran edited comment on ISPN-670 at 9/24/10 5:15 PM:
---------------------------------------------------------
public void testEvictionMaxEntries() throws Exception {
int maxEntries = 128;
Configuration configuration = new Configuration();
configuration.setEvictionStrategy(EvictionStrategy.LIRS);
configuration.setEvictionThreadPolicy(EvictionThreadPolicy.PIGGYBACK);
configuration.setEvictionWakeUpInterval(100);
configuration.setEvictionMaxEntries(maxEntries);
EmbeddedCacheManager manager = new DefaultCacheManager(configuration);
Cache<String, String> cache = manager.getCache();
for (int i = 0; i < 256; i++) {
cache.put("key-" + (i + 1), "value-" + (i + 1), 1, TimeUnit.MINUTES); // makes entry mortal
}
Thread.sleep(1000); // sleep long enough to allow the thread to wake-up
assertTrue("cache size too big: " + cache.size(), maxEntries >= cache.size());
}
public void testExpirationMaxIdle() throws Exception {
int maxEntries = 128;
Configuration configuration = new Configuration();
configuration.setEvictionStrategy(EvictionStrategy.LIRS);
configuration.setEvictionThreadPolicy(EvictionThreadPolicy.PIGGYBACK);
configuration.setEvictionWakeUpInterval(100);
configuration.setEvictionMaxEntries(maxEntries);
configuration.setExpirationMaxIdle(2000);
EmbeddedCacheManager manager = new DefaultCacheManager(configuration);
Cache<String, String> cache = manager.getCache();
for (int i = 0; i < 256; i++) {
cache.put("key-" + (i + 1), "value-" + (i + 1)); // immortal entry with maxIdle
}
Thread.sleep(1000); // sleep long enough to allow the thread to wake-up
assertTrue("cache size too big: " + cache.size(), maxEntries >= cache.size());
}
was (Author: owentran):
Needs to be able to pass the 1st test of a mortal entry that should be evicted to bring the size back down to 128.
public void testEvictionMaxEntries() throws Exception {
int maxEntries = 128;
Configuration configuration = new Configuration();
configuration.setEvictionStrategy(EvictionStrategy.LIRS);
configuration.setEvictionThreadPolicy(EvictionThreadPolicy.PIGGYBACK);
configuration.setEvictionWakeUpInterval(100);
configuration.setEvictionMaxEntries(maxEntries);
EmbeddedCacheManager manager = new DefaultCacheManager(configuration);
Cache<String, String> cache = manager.getCache();
for (int i = 0; i < 256; i++) {
cache.put("key-" + (i + 1), "value-" + (i + 1), 1, TimeUnit.MINUTES);
}
Thread.sleep(1000); // sleep long enough to allow the thread to wake-up
assertTrue("cache size too big: " + cache.size(), maxEntries >= cache.size());
}
public void testExpirationMaxIdle() throws Exception {
int maxEntries = 128;
Configuration configuration = new Configuration();
configuration.setEvictionStrategy(EvictionStrategy.LIRS);
configuration.setEvictionThreadPolicy(EvictionThreadPolicy.PIGGYBACK);
configuration.setEvictionWakeUpInterval(100);
configuration.setEvictionMaxEntries(maxEntries);
configuration.setExpirationMaxIdle(100);
EmbeddedCacheManager manager = new DefaultCacheManager(configuration);
Cache<String, String> cache = manager.getCache();
for (int i = 0; i < 256; i++) {
cache.put("key-" + (i + 1), "value-" + (i + 1), 1, TimeUnit.MINUTES);
}
Thread.sleep(1000); // sleep long enough to allow the thread to wake-up
assertEquals(0, cache.size());
}
> Consider all entries from data container as eviction candidates
> ---------------------------------------------------------------
>
> Key: ISPN-670
> URL: https://jira.jboss.org/browse/ISPN-670
> Project: Infinispan
> Issue Type: Bug
> Components: Eviction
> Affects Versions: 4.1.0.Final, 4.2.0.ALPHA2
> Reporter: Vladimir Blagojevic
> Assignee: Vladimir Blagojevic
>
> There was a subtle change of eviction semantics starting with 4.1 where only immortal entries are considered as eviction candidates. By default all entries are immortal, that is, their expiration and lifespan are -1. As soon as mortal entries are used (expiration !=-1 || lifespan !=-1) they are not subject to eviction policies and container size can grow above limit specified in maxEntries.
> This policy is confusing and it does not make a lot of sense. All candidates, both mortal and immortal should be considered as eviction candidates and as such subject to eviction.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list