我有一个Vaadin应用程序的问题,它创建了一些线程,Tomcat说他们可能会导致内存泄漏问题。 我没有以明确的方式创建线程。
SEVERE: The web application [/MyApp] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
ott 29, 2012 9:52:00 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
和
SEVERE: The web application [/MyApp] created a ThreadLocal with key of type [org.apache.axiom.util.UIDGenerator$1] (value [org.apache.axiom.util.UIDGenerator$1@1f7b22b]) and a value of type [org.apache.axiom.util.UIDGeneratorImpl] (value [org.apache.axiom.util.UIDGeneratorImpl@d25438]) 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.
ott 29, 2012 9:52:00 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/MyApp] created a ThreadLocal with key of type [org.apache.axiom.util.UIDGenerator$1] (value [org.apache.axiom.util.UIDGenerator$1@1f7b22b]) and a value of type [org.apache.axiom.util.UIDGeneratorImpl] (value [org.apache.axiom.util.UIDGeneratorImpl@975b37]) 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.
这让应用程序非常不稳定。
在开发过程中,这是我第一次遇到此错误。
如何避免这些问题?
答案 0 :(得分:2)
这些问题都与Vaadin完全没有任何关系。
您(或您正在使用的图书馆)创建了java.util.Timer
但尚未取消它。
此外,“Threadlocal”问题似乎是由Apache Axiom引起的,并且似乎已在Axiom 1.2.12中修复(请参阅http://ws.apache.org/axiom/和http://ws.apache.org/axiom/)