You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2016/05/05 16:31:48 UTC

svn commit: r1742448 - in /tomcat/trunk: java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java webapps/docs/changelog.xml webapps/docs/config/listeners.xml

Author: markt
Date: Thu May  5 16:31:48 2016
New Revision: 1742448

URL: http://svn.apache.org/viewvc?rev=1742448&view=rev
Log:
Remove unnecessary code

Modified:
    tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
    tomcat/trunk/webapps/docs/changelog.xml
    tomcat/trunk/webapps/docs/config/listeners.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=1742448&r1=1742447&r2=1742448&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java Thu May  5 16:31:48 2016
@@ -75,19 +75,6 @@ public class JreMemoryLeakPreventionList
     }
 
     /**
-     * Protect against the memory leak caused when the
-     * <code>sun.java2d.Disposer</code> class is loaded by a web application.
-     * Defaults to <code>false</code> because a new Thread is launched.
-     */
-    private boolean java2dDisposerProtection = false;
-    public boolean isJava2DDisposerProtection() {
-        return java2dDisposerProtection;
-    }
-    public void setJava2DDisposerProtection(boolean java2dDisposerProtection) {
-        this.java2dDisposerProtection = java2dDisposerProtection;
-    }
-
-    /**
      * Protect against the memory leak caused when the first call to
      * <code>sun.misc.GC.requestLatency(long)</code> is triggered by a web
      * application. This first call will start a GC Daemon thread with the
@@ -240,17 +227,6 @@ public class JreMemoryLeakPreventionList
                     java.awt.Toolkit.getDefaultToolkit();
                 }
 
-                // Trigger the creation of the "Java2D Disposer" thread.
-                // See https://bz.apache.org/bugzilla/show_bug.cgi?id=51687
-                if(java2dDisposerProtection) {
-                    try {
-                        Class.forName("sun.java2d.Disposer");
-                    } catch (ClassNotFoundException cnfe) {
-                        // Ignore this case: we must be running on a
-                        // non-Sun-based JRE.
-                    }
-                }
-
                 /*
                  * Several components end up calling
                  * sun.misc.GC.requestLatency(long) which creates a daemon

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1742448&r1=1742447&r2=1742448&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu May  5 16:31:48 2016
@@ -181,6 +181,12 @@
         the contents of <code>WEB-INF/classes</code> as a possible exploded JAR.
         (markt)
       </fix>
+      <scode>
+        Remove the <code>java2DDisposerProtection</code> option from the
+        <code>JreMemoryLeakPreventionListener</code>. The leak is fixed in Java
+        7 onwards and Tomcat 9 requires Java 8 so the option is unnecessary.
+        (markt)
+      </scode>
     </changelog>
   </subsection>
   <subsection name="Coyote">

Modified: tomcat/trunk/webapps/docs/config/listeners.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/listeners.xml?rev=1742448&r1=1742447&r2=1742448&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/listeners.xml (original)
+++ tomcat/trunk/webapps/docs/config/listeners.xml Thu May  5 16:31:48 2016
@@ -213,13 +213,6 @@
         startup on non-Sun JVMs. The default is <code>true</code>.</p>
       </attribute>
 
-      <attribute name="java2DDisposerProtection" required="false">
-        <p>Enables protection so that loading the
-        <code>sun.java2d.Disposer</code> class by a web application does not
-        result in a memory leak.
-        Defaults to <code>false</code> because a thread is launched.</p>
-      </attribute>
-
       <attribute name="ldapPoolProtection" required="false">
         <p>Enables protection so that the PoolCleaner thread started by
         <code>com.sun.jndi.ldap.LdapPoolManager</code> does not result in a



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