gpt4 book ai didi

web-applications - c3p0 中的内存泄漏 - java.lang.NoClassDefFoundError : com/mchange/v2/resourcepool/BasicResourcePool

转载 作者:行者123 更新时间:2023-12-02 22:43:46 26 4
gpt4 key购买 nike

环境:服务器:Jboss 4.2.3.GA

我们使用 c3p0 0.9.1.2 作为连接池。

每当我们在 Jboss AS 中热部署 war 文件时,都会遇到来自 c3p0 的内存泄漏。它最终导致“java.lang.OutOfMemoryError: PermGen space”错误,我们被迫重新启动我们的应用程序服务器。

有人遇到过这个问题吗?这个问题有什么解决方法吗?

Stacktrace如下:

14:50:16,097 INFO  [WebappClassLoader] Illegal access: this web application instance has been stopped already.  Could not load com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1244)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:980)
at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1406)
at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1378)
at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1462)
at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1937)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
14:50:22,328 ERROR [STDERR] Exception in thread "Timer-5"
14:50:22,329 ERROR [STDERR] java.lang.NoClassDefFoundError: com/mchange/v2/resourcepool/BasicResourcePool$1DestroyResourceTask
14:50:22,329 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:980)
14:50:22,329 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1406)
14:50:22,329 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1378)
14:50:22,329 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1462)
14:50:22,329 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:32)
14:50:22,329 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1937)
14:50:22,329 ERROR [STDERR] at java.util.TimerThread.mainLoop(Timer.java:512)
14:50:22,329 ERROR [STDERR] at java.util.TimerThread.run(Timer.java:462)
14:50:22,329 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask
14:50:22,329 ERROR [STDERR] at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
14:50:22,329 ERROR [STDERR] at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
14:50:22,329 ERROR [STDERR] ... 8 more
14:50:23,081 ERROR [STDERR] Exception in thread "Timer-6"
14:50:23,082 ERROR [STDERR] java.lang.NoClassDefFoundError: com/mchange/v2/resourcepool/BasicResourcePool$1DestroyResourceTask
14:50:23,082 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:980)
14:50:23,082 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1406)
14:50:23,082 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1378)
14:50:23,082 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1462)
14:50:23,082 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:32)
14:50:23,082 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1937)
14:50:23,082 ERROR [STDERR] at java.util.TimerThread.mainLoop(Timer.java:512)
14:50:23,083 ERROR [STDERR] at java.util.TimerThread.run(Timer.java:462)
14:51:59,105 INFO [WebappClassLoader] Illegal access: this web application instance has been stopped already. Could not load com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1244)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:980)
at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1406)
at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1378)
at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1462)
at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1937)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
^[[1;2C14:56:03,597 ERROR [STDERR] Exception in thread "Timer-11"
14:56:03,598 ERROR [STDERR] java.lang.NoClassDefFoundError: com/mchange/v2/resourcepool/BasicResourcePool$1DestroyResourceTask
14:56:03,598 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:980)
14:56:03,598 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1406)
14:56:03,598 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1378)
14:56:03,598 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1462)
14:56:03,598 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:32)
14:56:03,598 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1937)
Listening for transport dt_socket at address: 8787
14:56:03,598 ERROR [STDERR] at java.util.TimerThread.mainLoop(Timer.java:512)
14:56:03,598 ERROR [STDERR] at java.util.TimerThread.run(Timer.java:462)
14:56:03,598 ERROR [STDERR] Exception in thread "Timer-10"
14:56:03,607 ERROR [STDERR] java.lang.NoClassDefFoundError: com/mchange/v2/resourcepool/BasicResourcePool$1DestroyResourceTask
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:980)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1406)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1378)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1462)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:32)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1937)
14:56:03,607 ERROR [STDERR] at java.util.TimerThread.mainLoop(Timer.java:512)
14:56:03,607 ERROR [STDERR] at java.util.TimerThread.run(Timer.java:462)
14:56:03,607 ERROR [STDERR] Exception in thread "Timer-9"
14:56:03,607 ERROR [STDERR] java.lang.NoClassDefFoundError: com/mchange/v2/resourcepool/BasicResourcePool$1DestroyResourceTask
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:980)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1406)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1378)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1462)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:32)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1937)
14:56:03,607 ERROR [STDERR] at java.util.TimerThread.mainLoop(Timer.java:512)
14:56:03,607 ERROR [STDERR] at java.util.TimerThread.run(Timer.java:462)
14:56:03,607 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask
14:56:03,607 ERROR [STDERR] at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
14:56:03,607 ERROR [STDERR] at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
14:56:03,607 ERROR [STDERR] ... 8 more

最佳答案

Whenever we hot-deploy war files in Jboss AS are encountering the memory leak from c3p0.

如果您在 JBoss 4.2(或任何其他版本的 JBoss)中进行热部署,您最终会泄漏 PermGen 池中的内存,并且服务器将需要重新启动。据我所知,没有解决方法,而且它与 c3p0 无关。

在开发中,这只是一个小麻烦。在生产中,您根本不应该这样做。

关于web-applications - c3p0 中的内存泄漏 - java.lang.NoClassDefFoundError : com/mchange/v2/resourcepool/BasicResourcePool,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10350499/

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