[infinispan-issues] [JBoss JIRA] (ISPN-7171) LIRS eviction strategy leaks without cache hits

Ryan Gustafson (JIRA) issues at jboss.org
Mon Nov 7 17:23:00 EST 2016


Ryan Gustafson created ISPN-7171:
------------------------------------

             Summary: 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