Tomcat: Is Restart only solution to memory leak due to Threadlocal? -
we using apache-tomcat-8.0.20 in production environment.
our application (japha) got crashed , server got shut down automatically due following error:
25-nov-2015 05:20:37.311 severe [localhost-startstop-2] org.apache.catalina.loader.webappclassloaderbase.checkthreadlocalmapforleaks web application [japha] created threadlocal key of type [java.lang.threadlocal] (value [java.lang.threadlocal@2472eccc]) , value of type [com.sun.xml.stream.xmlreaderimpl] (value [com.sun.xml.stream.xmlreaderimpl@24d1f33]) failed remove when web application stopped. threads going renewed on time try , avoid probable memory leak. 25-nov-2015 05:20:37.311 severe [localhost-startstop-2] org.apache.catalina.loader.webappclassloaderbase.checkthreadlocalmapforleaks web application [japha] created threadlocal key of type [com.sun.xml.bind.v2.runtime.coordinator$1] (value [com.sun.xml.bind.v2.runtime.coordinator$1@73b0e605d]) , value of type [com.sun.xml.bind.v2.runtime.coordinator[]] (value [[lcom.sun.xml.bind.v2.runtime.coordinator;@2d42463a5b]) failed remove when web application stopped. threads going renewed on time try , avoid probable memory leak. and in end stopped connectors
25-nov-2015 05:20:37.327 severe [localhost-startstop-2] org.apache.catalina.loader.webappclassloaderbase.checkthreadlocalmapforleaks web application [japha] created threadlocal key of type [com.sun.xml.ws.api.client.serviceinterceptorfactory$1] (value [com.sun.xml.ws.api.client.serviceinterceptorfactory$1@434ba48d]) , value of type [java.util.hashset] (value [[]]) failed remove when web application stopped. threads going renewed on time try , avoid probable memory leak. 25-nov-2015 05:20:37.356 info [thread-7] org.apache.coyote.abstractprotocol.stop stopping protocolhandler ["http-nio-8080"] 25-nov-2015 05:20:37.453 info [thread-7] org.apache.coyote.abstractprotocol.stop stopping protocolhandler ["ajp-nio-8009"] 25-nov-2015 05:20:37.462 info [thread-7] org.apache.coyote.abstractprotocol.destroy destroying protocolhandler ["http-nio-8080"] 25-nov-2015 05:20:37.464 info [thread-7] org.apache.coyote.abstractprotocol.destroy destroying protocolhandler ["ajp-nio-8009"] no customer activity recorded in time period end user morning. restarted server , running fine. restart best solution this? or problem occur again?
because restart tomcat on each redeploy memory leak not caused classloader leak of tomcats webappclassloader common cause memory leaks related tomcat. therefore ignore link posted in comment.
instead should add vm parameter -xx:+heapdumponoutofmemoryerror heap dump created when outofmemoryerror occurs. when happens again, open heap dump heap dump analyzer eclipse mat . there further investigation in order find leak cause. e.g. dominator tree in order find objects hold amount of memory trough references. if you've found suspiciously post screenshot eclipse mat here.
if don't want wait until outofmemoryerror occurs again, manually create heapdump after application running while , analyse it.
Comments
Post a Comment