先前运行的tomcat类仍然存在 [英] tomcat classes from previous run remains

查看:125
本文介绍了先前运行的tomcat类仍然存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个使用spring,hibernate,jsf等的应用程序.该应用程序还使用ha-jdbc使数据库高度可用.第一次部署该应用程序时,该应用程序运行平稳,但是当取消部署并重新部署该应用程序时,tomcat会出现以下错误:

以下Web应用程序已停止(重新加载,取消部署),但是它们 先前运行的类仍会加载到内存中,从而导致内存不足 泄漏(使用探查器进行确认):

我想知道如何摆脱这个问题.有天才吗?

提前谢谢.

解决方案

使用探查器(visualvm会这样做),创建堆快照,查找遗留的对象,查找引用链,并思考为什么仍要引用它们. /p>

,或者只需为每个部署重新启动tomcat.

i am running an application which uses spring, hibernate, jsf, etc. the application also uses ha-jdbc to make the databases highly available. when the application is deployed for the first time, the app runs smoothly, but when it is un-deployed and deployed back, tomcat gives the following error:

The following web applications were stopped (reloaded, undeployed), but their classes from previous runs are still loaded in memory, thus causing a memory leak (use a profiler to confirm):

i am wondering how to get rid of this problem. any genius?

thanks in advance.

解决方案

use a profiler (visualvm would do), do a heap snapshot, find the lingering objects, find the reference chain, and ponder why they are still referenced.

or, just restart tomcat for each deployment.

这篇关于先前运行的tomcat类仍然存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆