Author: fhanik
Date: Mon Aug 27 14:15:36 2012
New Revision: 1377688

URL: http://svn.apache.org/viewvc?rev=1377688&view=rev
Log:
Per http://markmail.org/message/nqnogctvfuyzhtol

1. Already encountered two users that would like to set this value. There is 
never any need to hard code any value, regardless of its use
2. This turns it into a property on the listener



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

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=1377688&r1=1377687&r2=1377688&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
 Mon Aug 27 14:15:36 2012
@@ -218,6 +218,17 @@ public class JreMemoryLeakPreventionList
         this.classesToInitialize = classesToInitialize;
     }
     
+    /**
+     * Sets the time that this listener will request for garbage-collection 
latency
+     * @see {@link sun.misc.GC#requestLatency(long)}
+     */
+    private long gcDaemonPeriod = Long.MAX_VALUE - 1;
+    public long getGcDaemonPeriod() {
+        return gcDaemonPeriod;
+    }
+    public void setGcDaemonPeriod(long gcDaemonPeriod) {
+        this.gcDaemonPeriod = gcDaemonPeriod;
+    }
     
     @Override
     public void lifecycleEvent(LifecycleEvent event) {
@@ -297,7 +308,7 @@ public class JreMemoryLeakPreventionList
                         Method method = clazz.getDeclaredMethod(
                                 "requestLatency",
                                 new Class[] {long.class});
-                        method.invoke(null, 
Long.getLong("org.apache.catalina.core.jreMemoryLeakPreventionGCDaemonPeriod", 
Long.valueOf(Long.MAX_VALUE-1)));
+                        method.invoke(null, getGcDaemonPeriod());
                     } catch (ClassNotFoundException e) {
                         if (System.getProperty("java.vendor").startsWith(
                                 "Sun")) {

Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml?rev=1377688&r1=1377687&r2=1377688&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml Mon Aug 27 
14:15:36 2012
@@ -637,11 +637,6 @@
          <code>$CATALINA_BASE/catalina.properties</code> file.</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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to