tonivade / resp-server

Netty implementation of REdis Serialization Protocol, and a simple framework to implement command based protocols

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memory leak on netty bitebuf

tonivade opened this issue · comments

Using version 0.3.0 on tinydb, there are some errors in logs related to a leak

jun 25, 2016 11:27:26 AM io.netty.util.ResourceLeakDetector reportLeak
GRAVE: LEAK: ByteBuf.release() was not called before it's garbage-collected. See http://netty.io/wiki/reference-counted-objects.html for more information.
Recent access records: 2
#2:
    io.netty.buffer.AdvancedLeakAwareByteBuf.nioBuffer(AdvancedLeakAwareByteBuf.java:689)
    tonivade.redis.protocol.RedisDecoder.readBytes(RedisDecoder.java:40)
    tonivade.redis.protocol.RedisDecoder.readString(RedisDecoder.java:34)
    tonivade.redis.protocol.RedisDecoder.readLine(RedisDecoder.java:30)
    tonivade.redis.protocol.RedisDecoder.access$100(RedisDecoder.java:14)
    tonivade.redis.protocol.RedisDecoder$1.readLine(RedisDecoder.java:60)
    tonivade.redis.protocol.RedisParser.parse(RedisParser.java:35)
    tonivade.redis.protocol.RedisDecoder.parseResponse(RedisDecoder.java:64)
    tonivade.redis.protocol.RedisDecoder.decode(RedisDecoder.java:24)
    io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:367)
    io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
    io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
    io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)
    io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:321)
    io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1280)
    io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
    io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)
    io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:890)
    io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:564)
    io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:505)
    io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:419)
    io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:391)
    io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
    io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:145)
    java.lang.Thread.run(Thread.java:745)
#1:
    io.netty.buffer.AdvancedLeakAwareByteBuf.writeBytes(AdvancedLeakAwareByteBuf.java:581)
    io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:678)
    io.netty.handler.codec.ReplayingDecoderByteBuf.readBytes(ReplayingDecoderByteBuf.java:522)
    tonivade.redis.protocol.RedisDecoder.readBytes(RedisDecoder.java:40)
    tonivade.redis.protocol.RedisDecoder.readString(RedisDecoder.java:34)
    tonivade.redis.protocol.RedisDecoder.readLine(RedisDecoder.java:30)
    tonivade.redis.protocol.RedisDecoder.access$100(RedisDecoder.java:14)
    tonivade.redis.protocol.RedisDecoder$1.readLine(RedisDecoder.java:60)
    tonivade.redis.protocol.RedisParser.parse(RedisParser.java:35)
    tonivade.redis.protocol.RedisDecoder.parseResponse(RedisDecoder.java:64)
    tonivade.redis.protocol.RedisDecoder.decode(RedisDecoder.java:24)
    io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:367)
    io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
    io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
    io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)
    io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:321)
    io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1280)
    io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
    io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)
    io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:890)
    io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:564)
    io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:505)
    io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:419)
    io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:391)
    io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
    io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:145)
    java.lang.Thread.run(Thread.java:745)
Created at:
    io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java:280)
    io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:177)
    io.netty.buffer.AbstractByteBufAllocator.buffer(AbstractByteBufAllocator.java:113)
    io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:677)
    io.netty.handler.codec.ReplayingDecoderByteBuf.readBytes(ReplayingDecoderByteBuf.java:522)
    tonivade.redis.protocol.RedisDecoder.readBytes(RedisDecoder.java:40)
    tonivade.redis.protocol.RedisDecoder.readString(RedisDecoder.java:34)
    tonivade.redis.protocol.RedisDecoder.readLine(RedisDecoder.java:30)
    tonivade.redis.protocol.RedisDecoder.access$100(RedisDecoder.java:14)
    tonivade.redis.protocol.RedisDecoder$1.readLine(RedisDecoder.java:60)
    tonivade.redis.protocol.RedisParser.parse(RedisParser.java:35)
    tonivade.redis.protocol.RedisDecoder.parseResponse(RedisDecoder.java:64)
    tonivade.redis.protocol.RedisDecoder.decode(RedisDecoder.java:24)
    io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:367)
    io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
    io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
    io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)
    io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:321)
    io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1280)
    io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
    io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)
    io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:890)
    io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:564)
    io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:505)
    io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:419)
    io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:391)
    io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
    io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:145)
    java.lang.Thread.run(Thread.java:745)