gpt4 book ai didi

java - 使用 Hibernate 的 Java Web 服务中的内存泄漏

转载 作者:太空宇宙 更新时间:2023-11-04 06:44:33 24 4
gpt4 key购买 nike

我的应用程序似乎工作正常,但是当我停止服务器时,我收到这些消息。我不手动启动任何线程,但我对这些技术很陌生,我不确定它们内部是如何工作的。
我正在使用 C3p0 创建连接池,可能存在泄漏,因为连接关闭得不好,但我不知道正确的方法。但消息数量似乎可能会带来更多问题。
请有人告诉我这一切意味着什么以及如何解决内存泄漏?
请原谅我的英语不足。谢谢你们。

...
Information: Closing Spring root WebApplicationContext
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
Severe: The web application [/Consulta] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
Severe: The web application [/Consulta] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] but has failed to stop it. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
Severe: The web application [/Consulta] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1] but has failed to stop it. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
Severe: The web application [/Consulta] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] but has failed to stop it. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
Severe: The web application [/Consulta] appears to have started a thread named [MultiThreadedHttpConnectionManager cleanup] but has failed to stop it. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
Severe: The web application [/Consulta] appears to have started a thread named [Timer-1] but has failed to stop it. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
Severe: The web application [/Consulta] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] but has failed to stop it. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
Severe: The web application [/Consulta] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1] but has failed to stop it. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
Severe: The web application [/Consulta] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] but has failed to stop it. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
Severe: The web application [/Consulta] appears to have started a thread named [Timer-2] but has failed to stop it. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
Severe: The web application [/Consulta] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] but has failed to stop it. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
Severe: The web application [/Consulta] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1] but has failed to stop it. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
Severe: The web application [/Consulta] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] but has failed to stop it. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
Severe: The web application [/Consulta] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@aa7d6e]) and a value of type [org.apache.myfaces.config.RuntimeConfig] (value [org.apache.myfaces.config.RuntimeConfig@110d045]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
Severe: The web application [/Consulta] created a ThreadLocal with key of type [org.apache.xml.security.algorithms.SignatureAlgorithm$3] (value [org.apache.xml.security.algorithms.SignatureAlgorithm$3@10f67f1]) and a value of type [java.util.HashMap] (value [{http://vvv.w3.org/2000/09/xmldsig#rsa-sha1=Sun RSA private CRT key, 2048 bits
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
Severe: The web application [/Consulta] created a ThreadLocal with key of type [org.apache.xml.security.algorithms.MessageDigestAlgorithm$1] (value [org.apache.xml.security.algorithms.MessageDigestAlgorithm$1@711132]) and a value of type [java.util.HashMap] (value [{http://vvv.w3.org/2000/09/xmldsig#sha1=SHA-1 Message Digest from SUN, <initialized>
}]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
Severe: The web application [/Consulta] created a ThreadLocal with key of type [org.apache.myfaces.el.convert.VariableResolverToELResolver$1] (value [org.apache.myfaces.el.convert.VariableResolverToELResolver$1@1200ec5]) and a value of type [java.util.HashSet] (value [[]]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
Severe: The web application [/Consulta] created a ThreadLocal with key of type [org.apache.xml.security.utils.UnsyncBufferedOutputStream$1] (value [org.apache.xml.security.utils.UnsyncBufferedOutputStream$1@1a9e49c]) and a value of type [byte[]] (value [[B@dfebc1]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
Severe: The web application [/Consulta] created a ThreadLocal with key of type [org.apache.xml.security.utils.UnsyncByteArrayOutputStream$1] (value [org.apache.xml.security.utils.UnsyncByteArrayOutputStream$1@eedcc3]) and a value of type [byte[]] (value [[B@1dfadaa]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
Severe: The web application [/Consulta] created a ThreadLocal with key of type [org.apache.axis.utils.XMLUtils.ThreadLocalDocumentBuilder] (value [org.apache.axis.utils.XMLUtils$ThreadLocalDocumentBuilder@b1691a]) and a value of type [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl] (value [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl@16b470a]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
jun 12, 2014 2:32:09 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
Severe: The web application [/Consulta] created a ThreadLocal with key of type [org.apache.xml.security.algorithms.SignatureAlgorithm$1] (value [org.apache.xml.security.algorithms.SignatureAlgorithm$1@4e554]) and a value of type [java.util.HashMap] (value [{http://vvv.w3.org/2000/09/xmldsig#rsa-sha1=org.apache.xml.security.algorithms.implementations.SignatureBaseRSA$SignatureRSASHA1@16bf810}]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
jun 12, 2014 2:32:10 PM org.apache.coyote.http11.Http11Protocol destroy
Information: Parando Coyote HTTP/1.1 en puerto http-8080
jun 12, 2014 2:32:10 PM org.apache.coyote.http11.Http11Protocol destroy
Information: Parando Coyote HTTP/1.1 en puerto http-8443

最佳答案

对于com.mchange.v2.async.ThreadPoolAsynchronousRunner,请参阅How to shutdown connection pool on context unload? 。答案是指 Spring,但如果您不使用 Spring,您可以在 ServletContextListener 中调用 com.mchange.v2.c3p0.ComboPooledDataSourceclose() 方法。

对于Timer-0,如果上面的解决方案还不够,请参见Catalina.out Memory leak error (尤其是我自己的答案:https://stackoverflow.com/a/23336094/685806)。

关于java - 使用 Hibernate 的 Java Web 服务中的内存泄漏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24185091/

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