Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-7652

LRUQueryCache / IndexSearcher.DEFAULT_QUERY_CACHE memory leak

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: 5.4, 5.5
    • Fix Version/s: None
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Our IndexSearcher.DEFAULT_QUERY_CACHE is set to use 32MB of heap (the default), however upon inspection of our application's heap, it's retaining ~280MB of memory and increasing slowly.

      LRUQueryCache.cache.size was at 12,099, and LRUQueryCache.cache.modCount was also 12,099, meaning nothing was removed from LRUQueryCache.cache at all.

      The keys of LRUQueryCache.cache are instances of SegmentCoreReaders, and I've checked many of the keys, the only reference to them is LRUQueryCache.cache, given LRUQueryCache.cache is an IdentityHashMap, that means you can't even get to them outside of the cache because you can't get a key that's equivalent to one of these in the cache.

      This affectively makes IndexSearcher.DEFAULT_QUERY_CACHE a memory black hole.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                lae Lae
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: