Author: kkolinko
Date: Wed Jun  6 19:40:04 2012
New Revision: 1347072

URL: http://svn.apache.org/viewvc?rev=1347072&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53267
Stop the JreMemoryLeakPreventionListener triggering a full GC every hour

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    
tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1347072&r1=1347071&r2=1347072&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Jun  6 19:40:04 2012
@@ -147,15 +147,6 @@ PATCHES PROPOSED TO BACKPORT:
   +1: kkolinko
   -1:
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53267
-  Ensure that using the GC Daemon Protection feature of
-  the <code>JreMemoryLeakPreventionListener</code> does not trigger a
-  full GC every hour.
-  http://svn.apache.org/viewvc?view=revision&revision=1343895
-  (r1343897 in TC7)
-  +1: kkolinko, kfujino, markt, schultz
-  -1:
-
 * For https://issues.apache.org/bugzilla/show_bug.cgi?id=52055
   Ensure that filters are recycled.
   Inspired by r1334790 (TC7), r565964 (TC6 Nio)

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=1347072&r1=1347071&r2=1347072&view=diff
==============================================================================
--- 
tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
 (original)
+++ 
tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
 Wed Jun  6 19:40:04 2012
@@ -249,14 +249,19 @@ public class JreMemoryLeakPreventionList
                 if(awtThreadProtection) {
                   java.awt.Toolkit.getDefaultToolkit();
                 }
-                
+
                 /*
-                 * Several components end up calling:
-                 * sun.misc.GC.requestLatency(long)
+                 * Several components end up calling
+                 * sun.misc.GC.requestLatency(long) which creates a daemon
+                 * thread without setting the TCCL.
                  * 
                  * Those libraries / components known to trigger memory leaks
                  * due to eventual calls to requestLatency(long) are:
                  * - javax.management.remote.rmi.RMIConnectorServer.start()
+                 *
+                 * Note: Long.MAX_VALUE is a special case that causes the 
thread
+                 *       to terminate
+                 *
                  */
                 if (gcDaemonProtection) {
                     try {
@@ -264,7 +269,7 @@ public class JreMemoryLeakPreventionList
                         Method method = clazz.getDeclaredMethod(
                                 "requestLatency",
                                 new Class[] {long.class});
-                        method.invoke(null, Long.valueOf(3600000));
+                        method.invoke(null, Long.valueOf(Long.MAX_VALUE - 1));
                     } catch (ClassNotFoundException e) {
                         if (System.getProperty("java.vendor").startsWith(
                                 "Sun")) {

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1347072&r1=1347071&r2=1347072&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Wed Jun  6 19:40:04 2012
@@ -126,6 +126,11 @@
         <bug>53057</bug>: Add OpenSSL version number INFO log message when
         initializing. (schultz)
       </fix>
+      <fix>
+        <bug>53267</bug>: Ensure that using the GC Daemon Protection feature of
+        the <code>JreMemoryLeakPreventionListener</code> does not trigger a
+        full GC every hour. (markt/kkolinko)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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

Reply via email to