tomcat-以前运行的类仍在内存中加载 [英] tomcat - their classes from previous runs are still loaded in memory
本文介绍了tomcat-以前运行的类仍在内存中加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当停止我的项目时,tomcat说:
when stop my project , tomcat say :
以下Web应用程序已停止(重新加载,取消部署),但它们先前运行的类仍在 加载到内存中,从而导致内存泄漏(使用事件探查器进行确认).
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) .
我们在哪里发现内存中剩下哪些类?
Where we find that Which classes are left in memory ?
请帮助我.
推荐答案
您可以运行jmap -histo
,这将向您显示已加载的类.
You can run jmap -histo
which will show you loaded classes.
例如:
jmap -histo[:live] <pid>
to connect to running process and print histogram of java object heap
if the "live" suboption is specified, only count live objects
Example: jmap -dump:live,format=b,file=heap.bin <pid>
另一种方法是启用类加载调试信息,并执行一些脚本来检测剩下的内容.
Another way is to enable classloading debug information and do some scripting to detect what is left loaded.
这篇关于tomcat-以前运行的类仍在内存中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文