gpt4 book ai didi

tomcat - Vaadin 应用程序创建导致内存泄漏的线程

转载 作者:行者123 更新时间:2023-11-28 22:13:54 26 4
gpt4 key购买 nike

我有一个 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.

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

在开发过程中第一次遇到这个错误。

如何避免这些问题?

最佳答案

这些问题都与 Vaadin 完全无关。

您(或您正在使用的库)创建了一个 java.util.Timer 但没有取消它。

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

关于tomcat - Vaadin 应用程序创建导致内存泄漏的线程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13118484/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com