ChrisHegarty opened a new pull request, #16931:
URL: https://github.com/apache/lucene/pull/16931

   MMapDirectory groups the files of a segment into one reference counted 
shared arena. When an arena runs out of permits, or is already closing, a newer 
arena for the same group replaces it in the arenas map. The old arena stays 
alive until its inputs are closed. When it finally closes, it calls 
`arenas.remove(key)`, which removes whatever is mapped to that key, so it 
evicted the newer live arena. Later opens of that group could not find it and 
created more arenas than needed.
   
   I changed `RefCountedSharedArena` to pass itself to its `onClose` callback, 
and `MMapDirectory` now calls `arenas.remove(key, arena)`. The entry is removed 
only if it still points to the closing arena. Nothing else changes: memory is 
still unmapped when the last input of an arena is closed, whether or not the 
arena is in the map.
   
   This is a performance issue only. No arenas or mappings are leaked. Files in 
a group just may not share an arena, so more arenas are created and closed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to