Author: markt
Date: Tue May 29 18:22:50 2012
New Revision: 1343895
URL: http://svn.apache.org/viewvc?rev=1343895&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/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
Modified:
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=1343895&r1=1343894&r2=1343895&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
(original)
+++
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
Tue May 29 18:22:50 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")) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]