Netty Memory Leak Error

原创 2015年11月19日 15:52:56

1. Problem

1.1 Exception

java.lang.OutOfMemoryError: GC overhead limit exceeded
        at com.jcraft.jzlib.InfBlocks.<init>(InfBlocks.java:114)
        at com.jcraft.jzlib.Inflate.inflateInit(Inflate.java:181)
        at com.jcraft.jzlib.Inflater.init(Inflater.java:128)
        at com.jcraft.jzlib.Inflater.init(Inflater.java:114)
        at com.jcraft.jzlib.Inflater.init(Inflater.java:98)
        at io.netty.handler.codec.compression.JZlibDecoder.<init>(JZlibDecoder.java:50)
        at io.netty.handler.codec.compression.ZlibCodecFactory.newZlibDecoder(ZlibCodecFactory.java:111)
        at com.**.ClientHandler.messageReceived(ClientHandler.java:96)
        at com.**.ClientHandler.messageReceived(ClientHandler.java:1)
        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:84)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:153)
        at io.netty.channel.PausableChannelEventExecutor.invokeChannelRead(PausableChannelEventExecutor.java:86)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:389)
        at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:84)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:153)
        at io.netty.channel.PausableChannelEventExecutor.invokeChannelRead(PausableChannelEventExecutor.java:86)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:389)
        at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:84)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:153)
        at io.netty.channel.PausableChannelEventExecutor.invokeChannelRead(PausableChannelEventExecutor.java:86)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:389)
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:243)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:84)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:153)
        at io.netty.channel.PausableChannelEventExecutor.invokeChannelRead(PausableChannelEventExecutor.java:86)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:389)
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:243)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:84)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:153)


2. Analysis

2.1 Dump Analysis

pool chunk

2. 2 One Client Monitoring

memory leak caused by thread leak? 

noteworthy:

(1) heap size getting smaller

(2) threads number getting larger

(3) some threads in event loop group are in WAITING status.



monitoring-threads-waiting


2.3 Two clients monitoring

Noteworthy: after the second client started, threads number quickly rose up, so the root cause is clear, there are race conditions which leads to dead lock and WAITING threads.

two clients

two clients overnight:

two clients overnight 

Reference:

[1] Netty版本升级血泪史之线程篇. http://www.infoq.com/cn/articles/netty-version-upgrade-history-thread-part/

Memory leak detection for WinCE

  • 2011年04月28日 15:49
  • 2KB
  • 下载

c++ memory leak 检测代码

  • 2014年07月31日 04:20
  • 3.1MB
  • 下载

tomcat多次部署项目导致memory leak

这几日,忙着把改好的项目远程部署到web服务器上(tomcat原谅我还在用tomcat)之前也远程部署过一次,用的无线网,网速过慢第一次还没有成功。没办法吃完饭继续,累了趴了一会儿,没想到醒来就传好了...

BREW Memory Leak Checker

  • 2011年04月06日 18:14
  • 53KB
  • 下载

BREW Memory Leak Checker 20111109

  • 2011年11月09日 22:45
  • 217KB
  • 下载

Android内存监控与分析(一):内存泄漏(Memory Leak)与内存溢出(OOM)的表现

Android内存监控与分析(一)APP测试中难免会有各种显式或者隐式的内存泄漏(Memory Leak)问题,如果不及时发现处理,可能会因为内存泄漏导致各种奇怪的问题(如,卡顿和闪退),甚至可能出现...

BREW Memory Leak Checker 20111030

  • 2011年10月30日 19:07
  • 71KB
  • 下载

BREW Memory Leak Checker 20120219

  • 2012年02月19日 22:24
  • 325KB
  • 下载

简单的Memory leak跟踪(四)参考代码、组织和几个问题的讨论

参考代码 摘录了相关的代码,在小生的CSDN资源站里,0分下载,链接如下。 http://download.csdn.net/detail/noslopforever/4568056 转载请...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Netty Memory Leak Error
举报原因:
原因补充:

(最多只允许输入30个字)