automq icon indicating copy to clipboard operation
automq copied to clipboard

Memory Leak in `CompactionUploader` During Shutting Down

Open Chillax-0v0 opened this issue 1 year ago • 3 comments

2025-03-18 15:55:10.063 +0800 ERROR [io.netty.util.ResourceLeakDetector]  LEAK: ByteBuf.release() was not called before it's garbage-collected. See https://netty.io/wiki/reference-counted-objects.html for more information.
Recent access records: 
Created at:
	io.netty.buffer.AbstractByteBufAllocator.compositeDirectBuffer(AbstractByteBufAllocator.java:224)
	com.automq.stream.s3.ByteBufAlloc.compositeByteBuffer(ByteBufAlloc.java:128)
	com.automq.stream.s3.operator.ProxyWriter$ObjectWriter.<init>(ProxyWriter.java:127)
	com.automq.stream.s3.operator.ProxyWriter.<init>(ProxyWriter.java:33)
	com.automq.stream.s3.operator.ProxyWriter.<init>(ProxyWriter.java:48)
	com.automq.stream.s3.operator.AbstractObjectStorage.writer(AbstractObjectStorage.java:200)
	com.automq.stream.s3.compact.operator.DataBlockWriter.<init>(DataBlockWriter.java:59)
	com.automq.stream.s3.compact.CompactionUploader.lambda$writeStreamObject$5(CompactionUploader.java:116)
	java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150)
	java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
	java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	java.base/java.lang.Thread.run(Thread.java:840)

Chillax-0v0 avatar Mar 18 '25 08:03 Chillax-0v0

assign to me

kiranraoboinapally avatar Apr 22 '25 06:04 kiranraoboinapally

@kiranraoboinapally Hi, we appreciate your interest in this issue, however this is not a good first issue and may involve of a lot of core code changing, if this is your first time to AutoMQ, we recommend to start from other good first issues, thanks.

SCNieh avatar Apr 22 '25 06:04 SCNieh

@Chillax-0v0 Could you please share the exact code that’s causing this error?

check out this one 👉 Netty Reference Counted Objects: https://netty.io/wiki/reference-counted-objects.html

sriramsowmithri9807 avatar May 28 '25 06:05 sriramsowmithri9807