当停止我的项目时,tomcat说:
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) .
我们在哪里发现,哪些课程留在了记忆中?
请帮帮我。
当停止我的项目时,tomcat说:
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) .
我们在哪里发现,哪些课程留在了记忆中?
请帮帮我。
您可以运行jmap-histor
,它将显示加载的类。
例如:
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>
另一种方法是启用类加载调试信息,并执行一些脚本来检测剩余的加载内容。
当这种情况发生时,通常内存中会有一些东西将WebappClassLoader(负责为webapp实例加载类的类加载器)“固定”到内存中。如果您多次重新加载Web应用程序,每次重新加载时,您都会看到WebappClassLoader实例的数量增加1。这通常不是Tomcat中的泄漏,而是直接在Web应用程序代码中的泄漏、您使用的库中的泄漏或由一些做愚蠢事情的特定Java API调用触发的泄漏。
首先,请阅读以下内容:http://people.apache.org/~markt/演示文稿/2011-11-04-内存泄漏-60分钟.pdf。这是对正在发生的事情的精彩描述。
其次,使用分析器来确定是什么保存了对WebappClassLoader加载的对象的引用。很多时候,仅仅使用ServletContextListener就可以在Web应用程序停止时清理这些引用。
第三,如果您发现您使用的库存在泄漏,请让他们知道。如果您发现JRE中的类存在泄漏,则查看使用JreMemoryLeakPreventionListener的选项:http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html#JRE_Memory_Leak_Prevention_Listener_-_org.apache.catalina.core。JreMemory防泄漏侦听器。如果您发现的任何内容都没有选项,请访问Tomcat用户,让我们知道缺少什么:我们将添加它。
So this all began in trying to get Coldfusion9 portlets to run under Liferay, just like examples that I ve seen running JBOSS: http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSC00E3E9C-DC24-...
My web application uses the same database configuration as the application XYZ. I have a resource declaration for a context in server.xml, so I have a duplicated configuration (once for web ...
I am using Tomcat to host JSP and using IIS 7.0 to host aspx (C# + .Net 3.5 + VSTS 2008), and I have some session transfer issue from JSP page to ASPX page. JSP page is in one domain and all other ...
I have a Java web app using JDBC created in NetBeans deployed to Tomcat that gives a "java.sql.SQLException: No suitable driver found for ..." error. The same app works fine when I run it as a non-web ...
Why are my AJAX requests failing? I have a website www.foo.com, and I m running Tomcat on the same server, www.foo.com:8080/services. However, when a file on foo.com makes an ajax call as such: $....
I m setting up an existing application on a new Tomcat 5.5 server connecting to a Postgres database (running on Debian Lenny). When I access it I get a series of stack traces with the following root ...
I am developing my application using spring-web-mvc... Now at my Controller it returns like this : public class InterfacesManageController implements Controller { public ModelAndView ...
I have a webapp that runs perfectly in Apache Tomcat 5.5 and I need to "convert it" so it can be deployed in an Oracle Application Server 10.1.3. Right now I make a WAR file of the aplication, paste ...