[ https://issues.apache.org/jira/browse/LUCENE-9617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael McCandless resolved LUCENE-9617. ---------------------------------------- Fix Version/s: 8.8 Resolution: Fixed Thank you [~msfroh]! > FieldNumbers.clear() should reset lowestUnassignedFieldNumber > ------------------------------------------------------------- > > Key: LUCENE-9617 > URL: https://issues.apache.org/jira/browse/LUCENE-9617 > Project: Lucene - Core > Issue Type: Bug > Components: core/index > Affects Versions: 8.7 > Reporter: Michael Froh > Priority: Minor > Fix For: 8.8 > > Time Spent: 3h 50m > Remaining Estimate: 0h > > A call to IndexWriter.deleteAll() should completely reset the state of the > index. Part of that is a call to globalFieldNumbersMap.clear(), which purges > all knowledge of fields by clearing name -> number and number -> name maps. > However, it does not reset lowestUnassignedFieldNumber. > If we have loop that adds some documents, calls deleteAll(), adds documents, > etc. lowestUnassignedFieldNumber keeps counting up. Since FieldInfos > allocates an array for number -> FieldInfo, this array will get larger and > larger, effectively leaking memory. > We can fix this by resetting lowestUnassignedFieldNumber to -1 in > FieldNumbers.clear(). > I'll write a unit test and attach a patch. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org