1

我的 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.

这让应用程序非常不稳定。

在开发过程中,这是我第一次遇到此错误。

怎样才能避免这些问题?

4

1 回答 1

2

这些问题都与 Vaadin 没有任何关系。

您(或您正在使用的库)已创建java.util.Timer但尚未取消它。

此外,“Threadlocal”问题似乎是由 Apache Axiom 引起的,并且似乎在 Axiom 1.2.12 中得到了修复(参见http://ws.apache.org/axiom/http://ws.apache.org /公理/ )

于 2012-10-29T11:22:43.617 回答