rmuir commented on PR #12013:
URL: https://github.com/apache/lucene/pull/12013#issuecomment-1347422875

   Thanks, it looks better to use `CloseableThreadLocal` than `ThreadLocal`... 
but I don't understand what this "cache" is doing and why it actually documents 
that it never frees memory. Especially as a default!
   
   As a followup can we open an issue to move away from Threadlocal storage 
here by default? I don't understand why we have this "cache" with this 
description:
   ```
   /** A "cache" that never frees memory, and stores labels in a BytesRefHash 
(utf-8 encoding). */
   ```
   
   Also, I'm trying to remove ThreadLocal (and CloseableThreadLocal) usages 
elsewhere in the codebase (e.g. #11998). These threadlocals are problematic in 
java apps that have many threads (or high thread churn rate), just as 
CloseableThreadLocal documents and attempts to workaround.
   
   At a glance, seems to me that using a bounded LRU cache would be much more 
reasonable...


-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to