tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r1377689 - /tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
Date Mon, 27 Aug 2012 14:20:55 GMT
Author: fhanik
Date: Mon Aug 27 14:20:55 2012
New Revision: 1377689

URL: http://svn.apache.org/viewvc?rev=1377689&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/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=1377689&r1=1377688&r2=1377689&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java Mon Aug
27 14:20:55 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")) {



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


Mime
View raw message