Author: markt Date: Tue May 29 18:28:41 2012 New Revision: 1343897 URL: http://svn.apache.org/viewvc?rev=1343897&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/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1343895 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=1343897&r1=1343896&r2=1343897&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java Tue May 29 18:28:41 2012 @@ -279,12 +279,17 @@ public class JreMemoryLeakPreventionList } /* - * 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 { @@ -292,7 +297,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/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1343897&r1=1343896&r2=1343897&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue May 29 18:28:41 2012 @@ -135,6 +135,11 @@ <code>ClassFormatException</code> occurs during annotation scanning and do not prevent the web application from starting in this case. (markt) </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) + </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