在服务器停止(Eclipse,Hibernate,Spring)上获取内存泄漏错误

时间:2015-09-21 06:11:00

标签: java eclipse spring hibernate

当我取消部署战争(在eclipse上停止服务器)时,我得到以下日志。所有这些都很可疑,但我也更担心新工人#X。我正在使用hibernate,spring(guice),C3P0 lib来连接池。有什么想法吗?

2015-09-20 23:05:04.442 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2015-09-20 23:05:04.442 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] appears to have started a thread named [ForkJoinPool-2-worker-1] but has failed to stop it. This is very likely to create a memory leak.
2015-09-20 23:05:04.443 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
2015-09-20 23:05:04.443 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] appears to have started a thread named [java-sdk-http-connection-reaper] but has failed to stop it. This is very likely to create a memory leak.
2015-09-20 23:05:04.443 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] appears to have started a thread named [commons-pool-EvictionTimer] but has failed to stop it. This is very likely to create a memory leak.
2015-09-20 23:05:04.444 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] appears to have started a thread named [New I/O worker #1] but has failed to stop it. This is very likely to create a memory leak.
2015-09-20 23:05:04.444 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] appears to have started a thread named [New I/O worker #2] but has failed to stop it. This is very likely to create a memory leak.
2015-09-20 23:05:04.444 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] appears to have started a thread named [New I/O worker #3] but has failed to stop it. This is very likely to create a memory leak.
2015-09-20 23:05:04.444 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] appears to have started a thread named [New I/O worker #4] but has failed to stop it. This is very likely to create a memory leak.
2015-09-20 23:05:04.445 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] appears to have started a thread named [New I/O worker #5] but has failed to stop it. This is very likely to create a memory leak.
2015-09-20 23:05:04.445 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] appears to have started a thread named [New I/O worker #6] but has failed to stop it. This is very likely to create a memory leak.
2015-09-20 23:05:04.445 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] appears to have started a thread named [New I/O worker #7] but has failed to stop it. This is very likely to create a memory leak.
2015-09-20 23:05:04.445 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] appears to have started a thread named [New I/O worker #8] but has failed to stop it. This is very likely to create a memory leak.
2015-09-20 23:05:04.446 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] appears to have started a thread named [New I/O boss #9] but has failed to stop it. This is very likely to create a memory leak.
2015-09-20 23:05:04.446 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
2015-09-20 23:05:04.447 [localhost-startStop-2] [] ERROR o.a.c.loader.WebappClassLoader - The web application [] created a ThreadLocal with key of type [com.yammer.metrics.stats.ThreadLocalRandom$1] (value [com.yammer.metrics.stats.ThreadLocalRandom$1@78aa124e]) and a value of type [com.yammer.metrics.stats.ThreadLocalRandom] (value [com.yammer.metrics.stats.ThreadLocalRandom@6597fcc5]) 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.

1 个答案:

答案 0 :(得分:1)

您应该使用ServletContextListener来监听生命周期事件contextInitialized/contextDestroyed。有关示例,请参阅here