uschindler commented on PR #11715:
URL: https://github.com/apache/lucene/pull/11715#issuecomment-1225990121

   > We saw some weird behavior in Solr with a size-limited Caffeine cache not 
getting as many entries as we thought it should have. That turned out to be 
because sizeOf(Integer) was returning 1024 (Solr's default guess for how big 
something is), and while investigating that missing piece, I found the 
incongruity between the comments and the code around LongCache.
   
   PRO TIP: On Guava's caches, I generally use the `weighter()` method in the 
cache builder to help the cache with a function how to calculate the "weight" 
of objects. This helps the cache more than exact sizes of elements. It allows 
it to figure out relatively large elements. Not sure if Caffeine has the same 
(I don't recommend to use caffeine because it uses Unsafe....).


-- 
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