You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/12/12 22:19:51 UTC

[GitHub] [lucene] rmuir commented on pull request #12013: Clear thread local values on UTF8TaxonomyWriterCache.close()

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-unsubscribe@lucene.apache.org

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


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