lhotari commented on PR #24714:
URL: https://github.com/apache/pulsar/pull/24714#issuecomment-3266243825

   > I think we should not use any `CompletableFuture.xxxAsync()` method in 
Pulsar broker, unless we specify a thread pool using Netty 
`DefaultThreadlFactory`. I encountered `DataSketchesSummaryLogger` memory leak 
due to FastThreadLocal data not released after thread terminated when using mop.
   
   @oneby-wang What memory leak are you talking about? Is it a Netty ByteBuf 
leak?
   Have you tried setting `io.netty.allocator.cacheTrimIntervalMillis` to some 
value?
   ([Netty 4.1.x source 
code](https://github.com/netty/netty/blob/b7d832d4599acd8f9aff3609f7d17af232395715/buffer/src/main/java/io/netty/buffer/PooledByteBufAllocator.java#L145-L146))
   
   Threads in an executor will release the cached memory after the JVM runs the 
finalizer ([ref 
1](https://github.com/netty/netty/blob/b7d832d4599acd8f9aff3609f7d17af232395715/buffer/src/main/java/io/netty/buffer/PooledByteBufAllocator.java#L536-L538),
 [ref 
2](https://github.com/netty/netty/blob/b7d832d4599acd8f9aff3609f7d17af232395715/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java#L103),
 [ref 
3](https://github.com/netty/netty/blob/b7d832d4599acd8f9aff3609f7d17af232395715/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java#L486-L498)).


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