You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fh...@apache.org on 2012/08/27 01:48:01 UTC

svn commit: r1377544 - in /tomcat/trunk: java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java webapps/docs/config/systemprops.xml

Author: fhanik
Date: Sun Aug 26 23:48:01 2012
New Revision: 1377544

URL: http://svn.apache.org/viewvc?rev=1377544&view=rev
Log:
don't hard code values, no need to
https://issues.apache.org/bugzilla/show_bug.cgi?id=53267

Modified:
    tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
    tomcat/trunk/webapps/docs/config/systemprops.xml

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=1377544&r1=1377543&r2=1377544&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java Sun Aug 26 23:48:01 2012
@@ -297,7 +297,7 @@ public class JreMemoryLeakPreventionList
                         Method method = clazz.getDeclaredMethod(
                                 "requestLatency",
                                 new Class[] {long.class});
-                        method.invoke(null, Long.valueOf(Long.MAX_VALUE - 1));
+                        method.invoke(null, Long.getLong("org.apache.catalina.core.jreMemoryLeakPreventionGCDaemonPeriod", Long.valueOf(Long.MAX_VALUE-1)));
                     } catch (ClassNotFoundException e) {
                         if (System.getProperty("java.vendor").startsWith(
                                 "Sun")) {

Modified: tomcat/trunk/webapps/docs/config/systemprops.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/systemprops.xml?rev=1377544&r1=1377543&r2=1377544&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/systemprops.xml (original)
+++ tomcat/trunk/webapps/docs/config/systemprops.xml Sun Aug 26 23:48:01 2012
@@ -443,6 +443,11 @@
       else the default value will be <code>false</code>.</p>
     </property>
 
+    <property name="org.apache.catalina.core. jreMemoryLeakPreventionGCDaemonPeriod">
+      <p>The timeout period set when the leak prevention code triggers the GC Daemon.</p>
+      <p>If not specified, the default value of <code>Long.MAX_VALUE-1</code> will be used.</p>
+    </property>
+
   </properties>
 
 </section>



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


Re: svn commit: r1377544 - in /tomcat/trunk: java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java webapps/docs/config/systemprops.xml

Posted by Mark Thomas <ma...@apache.org>.

fhanik@apache.org wrote:

>Author: fhanik
>Date: Sun Aug 26 23:48:01 2012
>New Revision: 1377544
>
>URL: http://svn.apache.org/viewvc?rev=1377544&view=rev
>Log:
>don't hard code values, no need to
>https://issues.apache.org/bugzilla/show_bug.cgi?id=53267

-1 for two reasons:

1. Users should have no need to set this value. It is part of the internal Sun API. Tomcat sets it solely to avoid a memory leak and does so in a manner that will not affect the JVM setting any alternative value(s). I do not see any valid use case for a user needing to set this.

2. If such a setting were to be provided, it should be as a property of the listener, not as a system property. There is no requirement for a system property here.

Mark


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