ctubbsii commented on issue #1781: URL: https://github.com/apache/accumulo/issues/1781#issuecomment-728231263
SoftReferences are cleaned up at the discretion of the Garbage Collector. They are kept around longer, which is better for caching, because it is more likely you'll get a cache hit. However, that's not how we're using this cache. We're using WeakReferences, specifically because we're only using it for deduplication/canonicalization, and *not* cache hit performance. The javadoc for WeakReference says "Weak references are most often used to implement canonicalizing mappings.", which is how we are using it. The javadoc for SoftReference says "Soft references are most often used to implement memory-sensitive caches.", which is *not* how we are using it. I think what we have is correct. Also, this is a slight internal optimization so we don't have a ton of internal objects referring to the same table id, essentially the same as String interning. It is not something that would be worth making pluggable. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
