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

Queries that reference a TermContext can cause a memory leak when they are cached

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.5.4, 6.4.1, 6.5, 7.0
    • None
    • None
    • New

    Description

      The TermContext class has a reference to the top reader context of the IndexReader that was used to build it. So if you build a (Span)TermQuery that references a TermContext and this query gets cached, then it will keep holding a reference to the index reader, even after the latter gets closed.

      Attachments

        1. LUCENE-7657.patch
          3 kB
          Adrien Grand
        2. LUCENE-7657.patch
          10 kB
          Adrien Grand

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jpountz Adrien Grand
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: