ThreadLocal Error on Tomcat 6.0.29 [Updated]

當使用Tomcat Eclipse Plug-in 重啟Tomcat時,

會出現 …The web application … created a ThreadLocal with key of type … and a value of type … but failed to remove it when the web application was stopped. This is very likely to create a memory leak…的嚴重錯誤,

雖然程式還是可以執行, 但看到”嚴重”這兩個字就覺得不妙…

Tomcat的說法是在6.0.24以後增加了memory leak prevention listener所以可能有memory leak情況就會出現此exception.


1.如果真的沒有memory leak的話→忽略它

2.真的是memory leak→Fix it


4.把JreMemoryLeakPreventionListener 註解掉 (Tomcat/conf/server.xml)→視而不見…


Mark Thomas interview

Memory Analyzer (MAT)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s