Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-7171

LIRS eviction strategy leaks without cache hits

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 8.2.4.Final
    • None
    • None
    • Hide

      See attached JUnit test case.

      Show
      See attached JUnit test case.

      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:

      1. A size bounded cache using LRU with only puts does not leak. PASSES
      2. A size bounded cache using LIRS with only puts does leak. FAILS
      3. A size bounded cache using LIRS with intermittent cache hits does not leak. PASSES
      4. A size bounded cache using LIRS with intermittent cache misses does leak. FAILS
      5. 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.

            Unassigned Unassigned
            rgustav_jira Ryan Gustafson (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: