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

3.Downgrade到6.0.24以下→視而不見…

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

References:

Mark Thomas interview

http://confluence.atlassian.com/pages/viewpage.action?pageId=218275753

http://wiki.apache.org/tomcat/MemoryLeakProtection

Memory Analyzer (MAT)

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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