Net leak memory API

I am new to the netty API and I use netty3.5.2 to develop a client and server communication server, but the application always runs the full GC. I use jmap to reset the memory and use jhat to show which object took up memory.
And there are 6413363 instances of DefaultChannelFuture . can someone tell which thread creates instances of DefaultChannelFuture and how and when will they be released?

Top 4 suspects
6413363 instances of class org.jboss.netty.channel.DefaultChannelFuture
631971 instances of class org.jboss.netty.util.internal.LinkedTransferQueue$Node
630934 instances of class org.jboss.netty.buffer.BigEndianHeapChannelBuffer
630767 instances of class org.jboss.netty.channel.DownStreamMessageEvent

+6
source share
2 answers

You quickly generate messages. It overloads the message queue.

Check out the download of nethwork.

0
source

This question is a bit outdated, so I'm not sure if you found the answer. I have not used it, but Netty in Action describes a leak detector:

Netty contains the so-called ResourceLeakDetector , which will display about 1% of the buffer allocations to check if there is a leak in your application. If a leak is detected, you will see a log message similar to the following:

LEAK: ByteBuf.release () is not called before garbage collection. Enable Advanced to report where the leak occurred. To enable additional reporting leakage, specify the JVM option

-Dio.netty.leakDetectionLevel=advanced or call ResourceLeakDetector.setLevel()

0
source

All Articles