-
1. Re: unable to understand how infinispan is evicting entries from cache.
ranga033 Apr 3, 2012 10:34 AM (in response to venkataratnamteki)Do you have wakeupInterval to 10 milliseconds ? Can you post your complete program. At what point are you printing the values, immediately after the for loop ?
-
2. Re: unable to understand how infinispan is evicting entries from cache.
venkataratnamteki Apr 3, 2012 11:26 AM (in response to ranga033)My infinispan-config.xml is as follows..
<namedCache name="books">
<eviction wakeUpInterval="10" maxEntries="100" strategy="LRU"/>
<expiration maxIdle="50000" lifespan="50000" wakeUpInterval="10"/>
<transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
syncRollbackPhase="false" syncCommitPhase="true" useEagerLocking="false"/>
</namedCache>
DefaultCacheManager cm = new DefaultCacheManager("infinispan-config.xml");
Cache<String, String> booksCache = cm.getCache("books");
for(int i = 1; i < 100; i++) {
booksCache.put("key"+i, "value"+i);
}
System.out.println("Done put. ");
for(int i = 1; i < 100; i++) {
System.out.println(booksCache.get("key"+i));
}
}
The output is below...
Apr 3, 2012 8:55:30 PM org.infinispan.configuration.parsing.Parser parseEviction
WARN: ISPN000176: The 'wakeUpInterval' attribute of the 'eviction' configuration XML element is deprecated. Setting the 'wakeUpInterval' attribute of the 'expiration' configuration XML element to 10 instead
Apr 3, 2012 8:55:30 PM org.infinispan.factories.GlobalComponentRegistry start
INFO: ISPN000128: Infinispan version: Infinispan 'Brahma' 5.1.3.CR1
Apr 3, 2012 8:55:31 PM org.infinispan.transaction.lookup.GenericTransactionManagerLookup useDummyTM
WARN: ISPN000104: Falling back to DummyTransactionManager from Infinispan
Apr 3, 2012 8:55:31 PM org.infinispan.jmx.CacheJmxRegistration start
INFO: ISPN000031: MBeans were successfully registered to the platform mbean server.
Done put.
value1
null
value3
value4
null
null
value7
value8
value9
null
value11
value12
null
null
and...so on...
-
3. Re: unable to understand how infinispan is evicting entries from cache.
ranga033 Apr 4, 2012 4:08 AM (in response to venkataratnamteki)Looks wierd to me, but it seems this is caused by maxEntries. Increasing this value makes it to work fine though.
More details at :-
-
4. Re: unable to understand how infinispan is evicting entries from cache.
venkataratnamteki Apr 4, 2012 4:42 AM (in response to ranga033)Yes, increasing the maxEntries would do.. but, maxEntries=100 should be also working fine
i went through this link, but its not implicit for the developer!
-
5. Re: unable to understand how infinispan is evicting entries from cache.
ranga033 Apr 4, 2012 4:47 AM (in response to venkataratnamteki)Yes I agree on this with you. Ideally it should have been handled within Infinispan , else having maxentries and using only less than that value is something not right.
-
6. Re: unable to understand how infinispan is evicting entries from cache.
galder.zamarreno Apr 10, 2012 9:02 AM (in response to ranga033)Guys, this is all explained in the internals section of https://docs.jboss.org/author/x/MwY5
We even created an FAQ for it: https://docs.jboss.org/author/pages/viewpage.action?pageId=23036044