io.netty.util.internal.InternalThreadLocalMap,memory leak
See original GitHub issueExpected behavior
No memory leaks occur
Actual behavior
undeploy my web application.
Steps to reproduce
I use elasticsearch jar and it contains netty. when I close the ESClient in the contextDestroyed, the Glassfish logs show severe error, as follows.
Minimal yet complete reproducer code (or URL to code)
The web application [/service_generic_log] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5eeeaf73]) and a value of type [io.netty.util.internal.InternalThreadLocalMap] (value [io.netty.util.internal.InternalThreadLocalMap@6304ac92]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Netty version
netty-3.10.6 Final.jar
netty-buffer,codec,codec-http,common,handler,transport,handler-4.1.9.Final.jar
JVM version (e.g. java -version
)
openjdk version “1.8.0_111” OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2ubuntu0.16.04.2-b14) OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)
OS version (e.g. uname -a
)
Linux lyk 4.6.2-040602-generic #201606100516 SMP Fri Jun 10 09:18:34 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:33 (13 by maintainers)
Top GitHub Comments
Iam also having the same issue
SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [apprity] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@1994ff12]) and a value of type [io.netty.util.internal.InternalThreadLocalMap] (value [io.netty.util.internal.InternalThreadLocalMap@7d6a4e1e]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
is there any solution for this ?
Hi, I uploaded a repository with steps for reproducing the issue: https://github.com/scruz-denodo/netty-thread-local-issue
It contains two ways for checking the problem.
Some comments:
Thanks!