Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to test netty memory leak

I add -Dio.netty.leakDetection.level=ADVANCED for leak detecting on production. And there are some logs:

ERROR io.netty.util.ResourceLeakDetector - LEAK: ByteBuf.release() was not called before it's garbage-collected. See http://netty.io/wiki/reference-counted-objects.html for more information. WARNING: 4 leak records were discarded because the leak record count is limited to 4. Use system property io.netty.leakDetection.maxRecords to increase the limit. Recent access records: 5

Does it means it must will happen memory leak?

I want to test it on local environment, so I set -Dio.netty.leakDetection.level=PARANOID, but there are no the above memory leak records logs.

like image 891
fcbflying Avatar asked Nov 07 '22 22:11

fcbflying


1 Answers

To detect leak on my development environment, I have reduce the heap size to 12 MB with this vm argument: -mx12m

Now with this, Netty is able to detect some leaks.

like image 65
user1136452 Avatar answered Nov 15 '22 06:11

user1136452