[infinispan-issues] [JBoss JIRA] (ISPN-7171) LIRS eviction strategy leaks without cache hits
Ryan Gustafson (JIRA)
issues at jboss.org
Tue Nov 8 10:59:01 EST 2016
[ https://issues.jboss.org/browse/ISPN-7171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13319000#comment-13319000 ]
Ryan Gustafson commented on ISPN-7171:
--------------------------------------
Thank you for the detailed response. In researching the leak, I read this Caffeine issue thread https://github.com/ben-manes/caffeine/issues/23, and from there the TinyLFU paper you referenced.
Whether TinyLFU was already, or would be, incorporated into Infinispan wasn't clear to me. Glad to hear it's slated for 9.0. I'll re-evaluate the eviction strategies in the future, sticking to LRU for now.
Can you link this issue to the 9.0 issue with the new feature? I'd like to keep an eye on progress.
> LIRS eviction strategy leaks without cache hits
> -----------------------------------------------
>
> Key: ISPN-7171
> URL: https://issues.jboss.org/browse/ISPN-7171
> Project: Infinispan
> Issue Type: Bug
> Affects Versions: 8.2.4.Final
> Reporter: Ryan Gustafson
> Attachments: BoundedInfinispanCacheTest.java
>
>
> When using a size bounded cache with the LIRS eviction strategy and there are no cache hits, the cache will leak until OOM is triggered. This makes LIRS a risky choice for a bounded cache in which a large number of puts can occur before the arrival of a subsequent cache hit. At worst the application can go OOM, and at best it keeps working but suffers from randomly excessive heap usage.
> See attached JUnit test class. There are 5 cases in the test:
> # A size bounded cache using LRU with only puts does not leak. PASSES
> # A size bounded cache using LIRS with only puts does leak. FAILS
> # A size bounded cache using LIRS with intermittent cache hits does not leak. PASSES
> # A size bounded cache using LIRS with intermittent cache misses does leak. FAILS
> # A size bounded cache using LIRS with a single cache hit and subsequent intermittent cache misses does leak. FAILS
> The test was written assuming Java 8 and Infinispan 8.2.4. It should be run using the -Xmx64m JVM argument to limit heap size. Each test method should be run separately. The FAILING tests will throw OOME or have very slow progress with excessive garbage collection. The PASSING tests will run quickly through 1,000,000 cache puts.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the infinispan-issues
mailing list