divijvaidya commented on PR #13078:
URL: https://github.com/apache/kafka/pull/13078#issuecomment-1425521316

   > One concern is that the ConcurrentHashMap could take up more space. This 
metric was introduced to try to get this memory usage under control.
   
   The hash map in question here stores the number of idempotent producers. 
Which I assume is in "hundreds" in a busy cluster. As per this old benchmark 
https://stackoverflow.com/a/11104401 (newer JVMs may have even smaller 
footprint) we have an incremental usage of 8 bytes per entry, so we are talking 
about 800 bytes more? I think this is a reasonable tradeoff compared the 
out-of-the-box thread safety & code simplification that `ConcurrentHashMap` 
provides here. The tradeoff becomes even more appealing since the class in 
question, is accessed by multiple threads.


-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to