GeezerVison is showing github.com — memory leak netty version : 4.1.0.Beta7 · Issue #4450 · netty/netty
memory leak netty version : 4.1.0.Beta7 #4450
Description
here it is log
2015-11-07 174854 ERROR ResourceLeakDetector258 - LEAK ByteBuf.release() was not called before it's garbage-collected. See httpnetty.iowikireference-counted-objects.html for more information.
Recent access records 5
#5
io.netty.buffer.AdvancedLeakAwareByteBuf.slice(AdvancedLeakAwareByteBuf.java74)
io.netty.buffer.CompositeByteBuf.addComponent0(CompositeByteBuf.java173)
io.netty.buffer.CompositeByteBuf.addComponent(CompositeByteBuf.java115)
com.mastfrog.netty.http.client.MessageHandlerImpl$ResponseState.append(MessageHandlerImpl.java119)
com.mastfrog.netty.http.client.MessageHandlerImpl.channelRead(MessageHandlerImpl.java216)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java265)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java1110)
io.netty.handler.ssl.SslHandler.decode(SslHandler.java968)
io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java349)
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java244)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.proxy.ProxyHandler.channelRead(ProxyHandler.java254)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java946)
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java125)
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java510)
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java467)
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java381)
io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java353)
io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java742)
java.lang.Thread.run(Thread.java745)
#4
io.netty.buffer.AdvancedLeakAwareByteBuf.order(AdvancedLeakAwareByteBuf.java64)
io.netty.buffer.CompositeByteBuf.addComponent0(CompositeByteBuf.java173)
io.netty.buffer.CompositeByteBuf.addComponent(CompositeByteBuf.java115)
com.mastfrog.netty.http.client.MessageHandlerImpl$ResponseState.append(MessageHandlerImpl.java119)
com.mastfrog.netty.http.client.MessageHandlerImpl.channelRead(MessageHandlerImpl.java216)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java265)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java1110)
io.netty.handler.ssl.SslHandler.decode(SslHandler.java968)
io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java349)
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java244)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.proxy.ProxyHandler.channelRead(ProxyHandler.java254)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java946)
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java125)
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java510)
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java467)
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java381)
io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java353)
io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java742)
java.lang.Thread.run(Thread.java745)
#3
Hint 'handler' will handle the message from this point.
io.netty.handler.codec.http.DefaultHttpContent.touch(DefaultHttpContent.java78)
io.netty.handler.codec.http.DefaultLastHttpContent.touch(DefaultLastHttpContent.java80)
io.netty.handler.codec.http.DefaultLastHttpContent.touch(DefaultLastHttpContent.java28)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java156)
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java265)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java1110)
io.netty.handler.ssl.SslHandler.decode(SslHandler.java968)
io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java349)
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java244)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.proxy.ProxyHandler.channelRead(ProxyHandler.java254)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java946)
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java125)
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java510)
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java467)
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java381)
io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java353)
io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java742)
java.lang.Thread.run(Thread.java745)
#2
io.netty.buffer.AdvancedLeakAwareByteBuf.release(AdvancedLeakAwareByteBuf.java745)
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java252)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java1110)
io.netty.handler.ssl.SslHandler.decode(SslHandler.java968)
io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java349)
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java244)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.proxy.ProxyHandler.channelRead(ProxyHandler.java254)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java946)
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java125)
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java510)
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java467)
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java381)
io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java353)
io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java742)
java.lang.Thread.run(Thread.java745)
#1
io.netty.buffer.AdvancedLeakAwareByteBuf.retain(AdvancedLeakAwareByteBuf.java717)
io.netty.handler.codec.http.HttpObjectDecoder.decode(HttpObjectDecoder.java300)
io.netty.handler.codec.http.HttpClientCodec$Decoder.decode(HttpClientCodec.java160)
io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java349)
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java244)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java1110)
io.netty.handler.ssl.SslHandler.decode(SslHandler.java968)
io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java349)
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java244)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.proxy.ProxyHandler.channelRead(ProxyHandler.java254)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java946)
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java125)
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java510)
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java467)
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java381)
io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java353)
io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java742)
java.lang.Thread.run(Thread.java745)
Created at
io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java271)
io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java157)
io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java148)
io.netty.buffer.AbstractByteBufAllocator.buffer(AbstractByteBufAllocator.java85)
io.netty.handler.ssl.SslHandler.allocate(SslHandler.java1504)
io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java1025)
io.netty.handler.ssl.SslHandler.decode(SslHandler.java968)
io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java349)
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java244)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.proxy.ProxyHandler.channelRead(ProxyHandler.java254)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java946)
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java125)
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java510)
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java467)
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java381)
io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java353)
io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java742)
java.lang.Thread.run(Thread.java745)
2015-11-07 174854 ERROR ResourceLeakDetector258 - LEAK ByteBuf.release() was not called before it's garbage-collected. See httpnetty.iowikireference-counted-objects.html for more information.
Recent access records 0
Created at
io.netty.buffer.CompositeByteBuf.init(CompositeByteBuf.java63)
io.netty.buffer.AbstractByteBufAllocator.compositeDirectBuffer(AbstractByteBufAllocator.java193)
io.netty.buffer.AbstractByteBufAllocator.compositeDirectBuffer(AbstractByteBufAllocator.java188)
io.netty.buffer.AbstractByteBufAllocator.compositeBuffer(AbstractByteBufAllocator.java163)
com.mastfrog.netty.http.client.MessageHandlerImpl$ResponseState.init(MessageHandlerImpl.java106)
com.mastfrog.netty.http.client.MessageHandlerImpl.state(MessageHandlerImpl.java135)
com.mastfrog.netty.http.client.MessageHandlerImpl.channelRead(MessageHandlerImpl.java188)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java265)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java1110)
io.netty.handler.ssl.SslHandler.decode(SslHandler.java968)
io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java349)
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java244)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.handler.proxy.ProxyHandler.channelRead(ProxyHandler.java254)
io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java83)
io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java153)
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java157)
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java946)
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java125)
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java510)
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java467)
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java381)
io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java353)
io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java742)
java.lang.Thread.run(Thread.java745)
Activity
Scottmitch commented on Nov 7, 2015
@vitaliy-kuzmich - Can you explain why you feel this leak is in Netty? The buffer appears to be allocated in com.mastfrog.netty.http.client.MessageHandlerImpl$ResponseState.init(MessageHandlerImpl.java106). Can you explain the expected use case and interaction for this particular buffer, and where in your view things go wrong?
vitaliy-kuzmich commented on Nov 7, 2015
this error shows when I am reusing one bootstrap... with many connection as client, also I am using this lib: https://github.com/timboudreau/netty-http-client, but I changed netty version also added proxy handler to the pipeline. I just saw that message and was think that there is a memory leak, because as I remember netty uses Unsafe, so unsafe buffers should releases manually... PS Unsafe would be removed from Java9...
vitaliy-kuzmich commented on Nov 7, 2015
I'm sorry it seems http client issue...
Scottmitch commented on Nov 7, 2015
Metadata
Metadata
Development
No branches or pull requestsIssue actions