tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r988729 - in /tomcat/trunk: java/org/apache/catalina/startup/ContextConfig.java java/org/apache/catalina/startup/LocalStrings.properties webapps/docs/changelog.xml
Date Tue, 24 Aug 2010 21:08:34 GMT
Author: markt
Date: Tue Aug 24 21:08:34 2010
New Revision: 988729

URL: http://svn.apache.org/viewvc?rev=988729&view=rev
Log:
Fix memory leak on context stop

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
    tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=988729&r1=988728&r2=988729&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Tue Aug 24 21:08:34 2010
@@ -58,6 +58,7 @@ import org.apache.catalina.Globals;
 import org.apache.catalina.Host;
 import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.Pipeline;
 import org.apache.catalina.Valve;
@@ -299,6 +300,7 @@ public class ContextConfig
      *
      * @param event The lifecycle event that has occurred
      */
+    @Override
     public void lifecycleEvent(LifecycleEvent event) {
 
         // Identify the context we are associated with
@@ -929,6 +931,12 @@ public class ContextConfig
         Container[] children = context.findChildren();
         for (i = 0; i < children.length; i++) {
             context.removeChild(children[i]);
+            try {
+                children[i].destroy();
+            } catch (LifecycleException e) {
+                log.warn(sm.getString("contentConfig.destroyChildFailed",
+                        children[1].getName(), context.getName()), e);
+            }
         }
 
         // Removing application parameters

Modified: tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties?rev=988729&r1=988728&r2=988729&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties Tue Aug 24 21:08:34
2010
@@ -35,6 +35,7 @@ contextConfig.defaultError=Error process
 contextConfig.defaultMissing=No global web.xml found
 contextConfig.defaultPosition=Occurred at line {0} column {1}
 contextConfig.destroy=ContextConfig: Destroying
+contentConfig.destroyChildFailed=Failed to destroy child [{0}] of context [{1}]
 contextConfig.fileUrl=Unable to create a File object from the URL [{0}]
 contextConfig.fixDocBase=Exception fixing docBase for context [{0}] 
 contextConfig.init=ContextConfig: Initializing

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=988729&r1=988728&r2=988729&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Aug 24 21:08:34 2010
@@ -84,6 +84,11 @@
         CSRF prevention filter did not correctly handle URLs that used anchors.
         (markt)
       </fix>
+      <fix>
+        Fix memory leak on web application stopped caused by failed to
+        de-register the web application's Servlets with the MBean server.
+        (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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


Mime
View raw message