On 24.02.2010 01:07, ma...@apache.org wrote:
Author: markt
Date: Wed Feb 24 00:07:06 2010
New Revision: 915603

URL: http://svn.apache.org/viewvc?rev=915603&view=rev
Log:
Add basic memory leak detection for JMX and manager (kkolinko/markt)

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardHost.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardHost.java?rev=915603&r1=915602&r2=915603&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardHost.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardHost.java Wed 
Feb 24 00:07:06 2010

@@ -529,6 +549,49 @@

+     * Attempt to identify the contexts that have a class loader memory leak.
+     * This is usually triggered on context reload. Note: This method attempts
+     * to force a full garbage collection. This should be used with extreme
+     * caution on a production system.
+     */
+    public String[] findReloadedContextMemoryLeaks() {
+
+        System.gc();


Modified: tomcat/tc6.0.x/trunk/webapps/docs/html-manager-howto.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/html-manager-howto.xml?rev=915603&r1=915602&r2=915603&view=diff
==============================================================================

+<section name="Diagnostics">
+
+<p><strong>The find leaks diagnostic triggers a full garbage collection. It
+should be used with extreme caution on production systems.</strong></p>
+
+<p>The find leaks diagnostic attempts to identify web applications that have
+caused memory leaks when they were reloaded. Results should always be confirmed
+with a profiler. The diagnostic uses additional functionality provided by the
+StandardHost implementation. It will not work if a custom host is used that
+does not extend StandardHost.</p>
+

Modified: tomcat/tc6.0.x/trunk/webapps/docs/manager-howto.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/manager-howto.xml?rev=915603&r1=915602&r2=915603&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/manager-howto.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/manager-howto.xml Wed Feb 24 00:07:06 2010

+<p><strong>The find leaks diagnostic triggers a full garbage collection. It
+should be used with extreme caution on production systems.</strong></p>

Should we add a note, that the feature will not work in case System.gc() has been disabled, e.g. by setting -XX:+DisableExplicitGC on the command line (Sun VM)?

I think there's no good way yet to determine whether explicit GCs are possible or not. One could check the input arguments provided by the runtime platform mbean, but I think it's not worth it.

Cool stuff otherwise!

Regards,

Rainer



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to