oneby-wang commented on PR #24714:
URL: https://github.com/apache/pulsar/pull/24714#issuecomment-3266369903

   Hi, I'm talking about FastThreadLocal memory leak, 
`FastThreadLocal'remove()` method is called by `FastThreadLocalThread ` when 
thread is completed.
   
https://github.com/apache/pulsar/blob/56399ee448d7c3f3ba132206bb9425b8371f3301/pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/metrics/DataSketchesSummaryLogger.java#L117-L120
   
   If `DataSketchesSummaryLogger.ThreadLocalAccessor` is accessed by normal 
thread(not netty thread), map element will not be removed when thread is 
completed.
   
https://github.com/netty/netty/blob/255ad95343adcbc41b90dd3316560b6bd3af134c/common/src/main/java/io/netty/util/concurrent/FastThreadLocal.java#L302-L307
   
   I encountered this problem in our production cluster using mop. After I 
replace `canConsumeAsync` method with `allowTopicOperationAsync` method in mop, 
the memory leak problem is solved.
   
   And I haven't tried `io.netty.allocator.cacheTrimIntervalMillis`, I'll check 
the purpose of this parameter later.
   


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