LEAK: ByteBuf.release() was not called before it's garbage-collected. Enable advanced leak reporting

问题描述:

LEAK: ByteBuf.release() was not called before it's garbage-collected. Enable advanced leak reporting to find out where the leak occurred. To enable advanced leak reporting, specify the JVM option '-Dio.netty.leakDetectionLevel=advanced' or call ResourceLeakDetector.setLevel()

ByteBuf是一个引用计数对象,这个对象必须显示地 调用release()方法来释放。

解决方法:

@Override
 public void channelRead(ChannelHandlerContext ctx, Object msg) {
 try {
 // Do something with msg
} finally {
 ReferenceCountUtil.release(msg);
 }
 }
阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/cuiyaoqiang/article/details/52386022
个人分类: IO
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

LEAK: ByteBuf.release() was not called before it's garbage-collected. Enable advanced leak reporting

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭