apoorvmittal10 opened a new pull request, #23464:
URL: https://github.com/apache/kafka/pull/23464

   SharePartition registers Yammer gauges (InFlightMessageCount, 
InFlightBatchCount, etc.) whose suppliers capture the SharePartition instance. 
These gauges were never deregistered when a partition was removed from the 
cache, so the metrics registry kept a strong reference to every fenced 
SharePartition (and its cachedState) for the lifetime of the broker.
   
   Make SharePartition implement AutoCloseable and deregister its metrics in 
close() via SharePartitionMetrics 
   
   Verified against a live heap dump: after the fix there are zero live 
SharePartition and AcquisitionLockTimerTask instances; the only remaining 
SharePartition$$Lambda is a non-capturing per-call-site singleton (zero 
captured fields) bound to the class, not to any instance.


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

Reply via email to