lordcheng10 opened a new pull request #3061: URL: https://github.com/apache/bookkeeper/pull/3061
### Motivation We found that the pulsar broker frequently appeared Full Gc, and found by dumping the heap memory: org.apache.pulsar.broker.service.Consumer#pendingAcks occupies 9G of memory. The pendingAcks variable is defined as follows:  The heap memory usage is as follows:  I found that ConcurrentLongLongPairHashMap only supports expansion, not shrinkage, and most of the memory is not used and wasted. Of course, this structure is used not only in pulsar, but also in the read and write cache of bookkeeper, which will also lead to a lot of memory waste:  ### Changes When removing, judge whether to shrink. If the current use size is less than resizeThresholdBelow, then shrinking is required. if (size < resizeThresholdBelow) { try { // shrink the hashmap rehash(capacity / 2); } finally { unlockWrite(stamp); } } else { unlockWrite(stamp); } -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
