Affects Version/s: 8.5, 8.5.1
Fix Version/s: 8.6
I sent this to the mailing list
I'm moving from 8.3.1 to 8.5.1, and started getting Out Of Memory Errors while running our normal tests. After profiling it was clear that the majority of the heap was allocated through FuzzyQuery.
LUCENE-9068 moved construction of the automata from the FuzzyTermsEnum to the FuzzyQuery's constructor.
I created a little test ( FuzzyHammer.java ) that fires off fuzzy queries from random UUID strings for 5 minutes
When running against a vanilla Solr 8.31 and 8.4.1 there is no problem, while the memory usage has increased drastically on 8.5.0 and 8.5.1.
Comparison of heap usage while running the attached test against Solr 8.3.1 and 8.5.1 with a single (empty) shard and 4GB heap:
And with 4 shards on 8.4.1 and 8.5.0:
I'm guessing that the memory might be being leaked if the FuzzyQuery objects are referenced from the cache, while the FuzzyTermsEnum would not have been.
Query Result Cache on 8.5.1:
~316mb in the cache
QRC on 8.3.1
With an empty cache, running this query field_s:e41848af85d24ac197c71db6888e17bc~2 results in the following memory allocation
~1 gives 98253 and ~0 gives 6339 on 8.5.1. 8.3.1 is constant at 1520