This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new 424cd32 Remove JreLeakPreventionListener options that are not required 424cd32 is described below commit 424cd322dc60f9ee63e1175e4cf957353d79b88d Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Jul 28 12:28:50 2021 +0100 Remove JreLeakPreventionListener options that are not required Most of these were fixed in Java 9 --- .../core/JreMemoryLeakPreventionListener.java | 225 +-------------------- .../apache/catalina/core/LocalStrings.properties | 3 - .../catalina/core/LocalStrings_de.properties | 2 - .../catalina/core/LocalStrings_es.properties | 3 - .../catalina/core/LocalStrings_fr.properties | 3 - .../catalina/core/LocalStrings_ja.properties | 3 - .../catalina/core/LocalStrings_ko.properties | 3 - .../catalina/core/LocalStrings_zh_CN.properties | 3 - webapps/docs/config/listeners.xml | 69 ------- 9 files changed, 2 insertions(+), 312 deletions(-) diff --git a/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java b/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java index b3c56a5..7bed3ad 100644 --- a/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java +++ b/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java @@ -17,30 +17,19 @@ package org.apache.catalina.core; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.net.URLConnection; import java.sql.DriverManager; import java.util.StringTokenizer; -import java.util.concurrent.ForkJoinPool; import javax.imageio.ImageIO; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; import org.apache.catalina.Lifecycle; import org.apache.catalina.LifecycleEvent; import org.apache.catalina.LifecycleListener; -import org.apache.catalina.startup.SafeForkJoinWorkerThreadFactory; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; -import org.apache.tomcat.util.ExceptionUtils; import org.apache.tomcat.util.compat.JreCompat; -import org.apache.tomcat.util.compat.JreVendor; import org.apache.tomcat.util.res.StringManager; -import org.w3c.dom.Document; -import org.w3c.dom.ls.DOMImplementationLS; /** * Provide a workaround for known places where the Java Runtime environment can @@ -61,8 +50,6 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { private static final Log log = LogFactory.getLog(JreMemoryLeakPreventionListener.class); private static final StringManager sm = StringManager.getManager(JreMemoryLeakPreventionListener.class); - private static final String FORK_JOIN_POOL_THREAD_FACTORY_PROPERTY = - "java.util.concurrent.ForkJoinPool.common.threadFactory"; /** * Protect against the memory leak caused when the first call to * <code>sun.awt.AppContext.getAppContext()</code> is triggered by a web @@ -76,48 +63,6 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { } /** - * Protect against the memory leak caused when the first call to - * <code>java.awt.Toolkit.getDefaultToolkit()</code> is triggered - * by a web application. Defaults to <code>false</code> because a new - * Thread is launched. - */ - private boolean awtThreadProtection = false; - public boolean isAWTThreadProtection() { return awtThreadProtection; } - public void setAWTThreadProtection(boolean awtThreadProtection) { - this.awtThreadProtection = awtThreadProtection; - } - - /** - * 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 - * thread's context class loader configured to be the web application class - * loader. Defaults to <code>true</code>. - * - * @see "http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8157570" - */ - private boolean gcDaemonProtection = true; - public boolean isGcDaemonProtection() { return gcDaemonProtection; } - public void setGcDaemonProtection(boolean gcDaemonProtection) { - this.gcDaemonProtection = gcDaemonProtection; - } - - /** - * Protect against the memory leak, when the initialization of the - * Java Cryptography Architecture is triggered by initializing - * a MessageDigest during web application deployment. - * This will occasionally start a Token Poller thread with the thread's - * context class loader equal to the web application class loader. - * Instead we initialize JCA early. - * Defaults to <code>true</code>. - */ - private boolean tokenPollerProtection = true; - public boolean isTokenPollerProtection() { return tokenPollerProtection; } - public void setTokenPollerProtection(boolean tokenPollerProtection) { - this.tokenPollerProtection = tokenPollerProtection; - } - - /** * Protect against resources being read for JAR files and, as a side-effect, * the JAR file becoming locked. Note this disables caching for all * {@link URLConnection}s, regardless of type. Defaults to @@ -130,35 +75,6 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { } /** - * XML parsing can pin a web application class loader in memory. There are - * multiple root causes for this. Some of these are particularly nasty as - * profilers may not identify any GC roots related to the leak. For example, - * with YourKit you need to ensure that HPROF format memory snapshots are - * used to be able to trace some of the leaks. - */ - private boolean xmlParsingProtection = true; - public boolean isXmlParsingProtection() { return xmlParsingProtection; } - public void setXmlParsingProtection(boolean xmlParsingProtection) { - this.xmlParsingProtection = xmlParsingProtection; - } - - /** - * <code>com.sun.jndi.ldap.LdapPoolManager</code> class spawns a thread when - * it is initialized if the system property - * <code>com.sun.jndi.ldap.connect.pool.timeout</code> is greater than 0. - * That thread inherits the context class loader of the current thread, so - * that there may be a web application class loader leak if the web app - * is the first to use <code>LdapPoolManager</code>. - * - * @see "http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8156824" - */ - private boolean ldapPoolProtection = true; - public boolean isLdapPoolProtection() { return ldapPoolProtection; } - public void setLdapPoolProtection(boolean ldapPoolProtection) { - this.ldapPoolProtection = ldapPoolProtection; - } - - /** * The first access to {@link DriverManager} will trigger the loading of * all {@link java.sql.Driver}s in the the current class loader. The web * application level memory leak protection can take care of this in most @@ -173,21 +89,6 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { } /** - * {@link ForkJoinPool#commonPool()} creates a thread pool that, by default, - * creates threads that retain references to the thread context class - * loader. - * - * @see "http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8172726" - */ - private boolean forkJoinCommonPoolProtection = true; - public boolean getForkJoinCommonPoolProtection() { - return forkJoinCommonPoolProtection; - } - public void setForkJoinCommonPoolProtection(boolean forkJoinCommonPoolProtection) { - this.forkJoinCommonPoolProtection = forkJoinCommonPoolProtection; - } - - /** * List of comma-separated fully qualified class names to load and initialize during * the startup of this Listener. This allows to pre-load classes that are known to * provoke classloader leaks if they are loaded during a request processing. @@ -201,7 +102,6 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { } - @Override public void lifecycleEvent(LifecycleEvent event) { // Initialise these classes when Tomcat starts @@ -224,8 +124,7 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { ClassLoader loader = Thread.currentThread().getContextClassLoader(); - try - { + try { // Use the system classloader as the victim for all this // ClassLoader pinning we're about to do. Thread.currentThread().setContextClassLoader( @@ -241,7 +140,7 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { * - Batik * - others TBD * - * Note tha a call to sun.awt.AppContext.getAppContext() results + * Note that a call to sun.awt.AppContext.getAppContext() results * in a thread being started named AWT-AppKit that requires a * graphical environment to be available. */ @@ -253,67 +152,6 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { ImageIO.getCacheDirectory(); } - // Trigger the creation of the AWT (AWT-Windows, AWT-XAWT, - // etc.) thread. - // Note this issue is fixed in Java 8 update 05 onwards. - if (awtThreadProtection && !JreCompat.isJre9Available()) { - java.awt.Toolkit.getDefaultToolkit(); - } - - /* - * 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 - * - * Fixed in Java 9 onwards (from early access build 130) - */ - if (gcDaemonProtection && !JreCompat.isJre9Available()) { - try { - Class<?> clazz = Class.forName("sun.misc.GC"); - Method method = clazz.getDeclaredMethod( - "requestLatency", - new Class[] {long.class}); - method.invoke(null, Long.valueOf(Long.MAX_VALUE - 1)); - } catch (ClassNotFoundException e) { - if (JreVendor.IS_ORACLE_JVM) { - log.error(sm.getString( - "jreLeakListener.gcDaemonFail"), e); - } else { - log.debug(sm.getString( - "jreLeakListener.gcDaemonFail"), e); - } - } catch (SecurityException | NoSuchMethodException | IllegalArgumentException | - IllegalAccessException e) { - log.error(sm.getString("jreLeakListener.gcDaemonFail"), - e); - } catch (InvocationTargetException e) { - ExceptionUtils.handleThrowable(e.getCause()); - log.error(sm.getString("jreLeakListener.gcDaemonFail"), - e); - } - } - - /* - * Creating a MessageDigest during web application startup - * initializes the Java Cryptography Architecture. Under certain - * conditions this starts a Token poller thread with TCCL equal - * to the web application class loader. - * - * Instead we initialize JCA right now. - * - * Fixed in Java 9 onwards (from early access build 133) - */ - if (tokenPollerProtection && !JreCompat.isJre9Available()) { - java.security.Security.getProviders(); - } - /* * Several components end up opening JarURLConnections without * first disabling caching. This effectively locks the file. @@ -340,65 +178,6 @@ public class JreMemoryLeakPreventionListener implements LifecycleListener { } } - /* - * Fixed in Java 9 onwards (from early access build 133) - */ - if (xmlParsingProtection && !JreCompat.isJre9Available()) { - // There are two known issues with XML parsing that affect - // Java 8+. The issues both relate to cached Exception - // instances that retain a link to the TCCL via the - // backtrace field. Note that YourKit only shows this field - // when using the HPROF format memory snapshots. - // https://bz.apache.org/bugzilla/show_bug.cgi?id=58486 - // https://bugs.openjdk.java.net/browse/JDK-8146961 - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - try { - DocumentBuilder documentBuilder = factory.newDocumentBuilder(); - // Issue 1 - // com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl - Document document = documentBuilder.newDocument(); - document.createElement("dummy"); - DOMImplementationLS implementation = - (DOMImplementationLS)document.getImplementation(); - implementation.createLSSerializer().writeToString(document); - // Issue 1 - // com.sun.org.apache.xerces.internal.dom.DOMNormalizer - document.normalize(); - } catch (ParserConfigurationException e) { - log.error(sm.getString("jreLeakListener.xmlParseFail"), - e); - } - } - - /* - * Fixed in Java 9 onwards (from early access build 130) - */ - if (ldapPoolProtection && !JreCompat.isJre9Available()) { - try { - Class.forName("com.sun.jndi.ldap.LdapPoolManager"); - } catch (ClassNotFoundException e) { - if (JreVendor.IS_ORACLE_JVM) { - log.error(sm.getString( - "jreLeakListener.ldapPoolManagerFail"), e); - } else { - log.debug(sm.getString( - "jreLeakListener.ldapPoolManagerFail"), e); - } - } - } - - /* - * Present in Java 7 onwards - * Fixed in Java 9 (from early access build 156) - */ - if (forkJoinCommonPoolProtection && !JreCompat.isJre9Available()) { - // Don't override any explicitly set property - if (System.getProperty(FORK_JOIN_POOL_THREAD_FACTORY_PROPERTY) == null) { - System.setProperty(FORK_JOIN_POOL_THREAD_FACTORY_PROPERTY, - SafeForkJoinWorkerThreadFactory.class.getName()); - } - } - if (classesToInitialize != null) { StringTokenizer strTok = new StringTokenizer(classesToInitialize, ", \r\n\t"); diff --git a/java/org/apache/catalina/core/LocalStrings.properties b/java/org/apache/catalina/core/LocalStrings.properties index 7c05313..f97d42a 100644 --- a/java/org/apache/catalina/core/LocalStrings.properties +++ b/java/org/apache/catalina/core/LocalStrings.properties @@ -141,10 +141,7 @@ jniLifecycleListener.load.path=Loaded native library from [{0}] jniLifecycleListener.missingPathOrName=One of libraryName or libraryPath must be set jreLeakListener.classToInitializeFail=Failed to load class [{0}] during Tomcat start to prevent possible memory leaks. -jreLeakListener.gcDaemonFail=Failed to trigger creation of the GC Daemon thread during Tomcat start to prevent possible memory leaks. This is expected on non-Sun JVMs. jreLeakListener.jarUrlConnCacheFail=Failed to disable Jar URL connection caching by default -jreLeakListener.ldapPoolManagerFail=Failed to trigger creation of the com.sun.jndi.ldap.LdapPoolManager class during Tomcat start to prevent possible memory leaks. This is expected on non-Sun JVMs. -jreLeakListener.xmlParseFail=Error whilst attempting to prevent memory leaks during XML parsing naming.addEnvEntry=Adding environment entry [{0}] naming.addResourceEnvRef=Adding resource env ref [{0}] diff --git a/java/org/apache/catalina/core/LocalStrings_de.properties b/java/org/apache/catalina/core/LocalStrings_de.properties index 3a3ac20..3353b87 100644 --- a/java/org/apache/catalina/core/LocalStrings_de.properties +++ b/java/org/apache/catalina/core/LocalStrings_de.properties @@ -31,8 +31,6 @@ defaultInstanceManager.invalidInjection=Ungültige ressource injection Annotatio filterChain.filter=Während der Filter Bearbeitung trat eine Exception auf -jreLeakListener.ldapPoolManagerFail=Konnte die Erzeugung der Klasse com.sun.jndi.ldap.LdapPoolManager während des Starts von Tomcat nicht auslösen. Dies sollte zur Vermeidung von Memory-Leaks dienen. Der Fehlschlag ist ein erwartetes Verhalten bei nicht-Sun JVMs. - naming.addEnvEntry=Füge Umgebungseintrag [{0}] hinzu naming.namingContextCreationFailed=Erzeugung des Naming-Contexts ist fehlgeschlagen: [{0}] naming.wsdlFailed=Die WSDL Datei [{0}] wurde nicht gefunden. diff --git a/java/org/apache/catalina/core/LocalStrings_es.properties b/java/org/apache/catalina/core/LocalStrings_es.properties index 89d247d..62ca876 100644 --- a/java/org/apache/catalina/core/LocalStrings_es.properties +++ b/java/org/apache/catalina/core/LocalStrings_es.properties @@ -79,10 +79,7 @@ defaultInstanceManager.restrictedServletsResource=No se ha hallado el fichero de filterChain.filter=La ejecución del Filtro lanzó una excepción filterChain.servlet=La ejecución del Servlet lanzó una excepción -jreLeakListener.gcDaemonFail=No pude disparar la creación del hilo Daemon GC durante el arranque de Tomcat para prevenir posibles fallos de memoria. Esto es lo esperado en JVMs no Sun. jreLeakListener.jarUrlConnCacheFail=No pude desactivar la caché de conexión URL de Jar por defecto -jreLeakListener.ldapPoolManagerFail=No pude disparar la creación de la clase com.sun.jndi.ldap.LdapPoolManager durante el arranque de Tomcat para prevenir posibles fallos de memoria. Esto es lo que se espera si las JVMs no son Sun. -jreLeakListener.xmlParseFail=Error mientras intentaba prevenir fallos de memoria durante el análisis XML naming.addEnvEntry=Adicionando entrada de ambiente [{0}]\n naming.bindFailed=No pude cambiar (bind) objeto: [{0}] diff --git a/java/org/apache/catalina/core/LocalStrings_fr.properties b/java/org/apache/catalina/core/LocalStrings_fr.properties index 5778813..b587487 100644 --- a/java/org/apache/catalina/core/LocalStrings_fr.properties +++ b/java/org/apache/catalina/core/LocalStrings_fr.properties @@ -141,10 +141,7 @@ jniLifecycleListener.load.path=La librairie native a été chargée à partir de jniLifecycleListener.missingPathOrName=Soit libraryName soit libraryPath doivent être définis jreLeakListener.classToInitializeFail=Echec du chargement de la classe [{0}] pendant le démarrage de Tomcat, effectué pour empêcher de possibles fuites de mémoire -jreLeakListener.gcDaemonFail=Echec de la création du thread GC Daemon durant le démarrage de Tomcat pour éviter une fuite de mémoire, cela est normal sur toutes les JVMs non Oracle jreLeakListener.jarUrlConnCacheFail=Échec de la désactivation du cache par défaut des URL de connexion de JAR -jreLeakListener.ldapPoolManagerFail=Echec de la création de la classe com.sun.jndi.ldap.LdapPoolManager durant le démarrage de Tomcat pour éviter une fuite de mémoire, cela est normal sur toutes les JVMs non Oracle -jreLeakListener.xmlParseFail=Erreur en essayant de prévenir une fuite de mémoire lors du traitement de contenu XML naming.addEnvEntry=Ajout de l''entrée d''environnement [{0}] naming.addResourceEnvRef=Ajout de la référence de ressource d''environnement [{0}] diff --git a/java/org/apache/catalina/core/LocalStrings_ja.properties b/java/org/apache/catalina/core/LocalStrings_ja.properties index 1f4b3b6..11e99fe 100644 --- a/java/org/apache/catalina/core/LocalStrings_ja.properties +++ b/java/org/apache/catalina/core/LocalStrings_ja.properties @@ -141,10 +141,7 @@ jniLifecycleListener.load.path=[{0}] からネイティブライブラリを読 jniLifecycleListener.missingPathOrName=libraryName あるいは libraryPath を設定しなければなりません。 jreLeakListener.classToInitializeFail=Tomcat起動中に可能なメモリーリークを防止するためのクラス[{0}]をロードすることに失敗しました。 -jreLeakListener.gcDaemonFail=Tomcat の開始時に潜在的なメモリーリークを防ぐ GC デーモンスレッドの作成を開始できませんでした。Sun の JVM ではない可能性があります。 jreLeakListener.jarUrlConnCacheFail=既定でJar URL接続のキャッシュを無効にできませんでした。 -jreLeakListener.ldapPoolManagerFail=Tomcatの起動時にメモリリークを防ぐ為にcom.sun.jndi.ldap.LdapPoolManagerクラスの作成をトリガーすることができませんでした。 これはSun以外のJVMであることが予想されます。 -jreLeakListener.xmlParseFail=XML解析中のメモリリークを防止を試行する際のエラー naming.addEnvEntry=環境変数 [{0}] を追加します。 naming.addResourceEnvRef=リソースenv ref [{0}]を追加しています。 diff --git a/java/org/apache/catalina/core/LocalStrings_ko.properties b/java/org/apache/catalina/core/LocalStrings_ko.properties index 30d4a92..0f25107 100644 --- a/java/org/apache/catalina/core/LocalStrings_ko.properties +++ b/java/org/apache/catalina/core/LocalStrings_ko.properties @@ -141,10 +141,7 @@ jniLifecycleListener.load.path=[{0}](으)로부터 native 라이브러리를 로 jniLifecycleListener.missingPathOrName=libraryName 또는 libraryPath, 둘 중 하나는 반드시 설정되어야 합니다. jreLeakListener.classToInitializeFail=Tomcat을 시작하던 중, 발생 가능성 있는 메모리 누수를 방지하기 위한 클래스 [{0}]을(를) 로드하지 못했습니다. -jreLeakListener.gcDaemonFail=Tomcat이 시작하는 동안, 가능성 있는 메모리 누수들을 방지하기 위한 GC Daemon 쓰레드 생성을 개시하지 못했습니다. 이는 Sun JVM들이 아닌 환경에서 발생할 수 있습니다. jreLeakListener.jarUrlConnCacheFail=기본 설정으로서, Jar URL 연결 캐싱을 사용불능 상태로 설정하지 못했습니다. -jreLeakListener.ldapPoolManagerFail=가능성 있는 메모리 누수들을 방지하기 위하여, Tomcat이 시작하는 동안, com.sun.jndi.ldap.LdapPoolManager 클래스 생성을 개시하지 못했습니다. 이는 Sun JVM들이 아닌 환경에서 발생할 수 있습니다. -jreLeakListener.xmlParseFail=XML 파싱하는 과정에서, 메모리 누수들을 방지하려 시도하는 중 오류 발생 naming.addEnvEntry=Environment 엔트리 [{0}]을(를) 추가합니다. naming.addResourceEnvRef=리소스 env ref [{0}]을(를) 추가합니다. diff --git a/java/org/apache/catalina/core/LocalStrings_zh_CN.properties b/java/org/apache/catalina/core/LocalStrings_zh_CN.properties index f840c8d..75977b7 100644 --- a/java/org/apache/catalina/core/LocalStrings_zh_CN.properties +++ b/java/org/apache/catalina/core/LocalStrings_zh_CN.properties @@ -142,10 +142,7 @@ jniLifecycleListener.load.path=已从[{0}]加载本机库 jniLifecycleListener.missingPathOrName=必须设置libraryName或libraryPath之一 jreLeakListener.classToInitializeFail=在tomcat启动期间未能加载类[{0}],以防止可能的内存泄漏。 -jreLeakListener.gcDaemonFail=Tomcat开始预防潜在的内存溢出期间,触发GC守护线程失败,在非Sun JVMs上这是正常的。 jreLeakListener.jarUrlConnCacheFail=默认情况下无法禁用Jar URL连接缓存。 -jreLeakListener.ldapPoolManagerFail=在Tomcat启动期间未能触发com.sun.jndi.ldap.LdapPoolManager类的创建以防止可能的内存泄漏。这在非Sun jvm上是预期的。 -jreLeakListener.xmlParseFail=尝试在XML解析期间防止内存泄漏时出错。 naming.addEnvEntry=添加环境条目 [{0}] naming.addResourceEnvRef=添加资源环境引用 [{0}] diff --git a/webapps/docs/config/listeners.xml b/webapps/docs/config/listeners.xml index 3a512bf..1638dfc 100644 --- a/webapps/docs/config/listeners.xml +++ b/webapps/docs/config/listeners.xml @@ -202,15 +202,6 @@ </p> </attribute> - <attribute name="AWTThreadProtection" required="false"> - <p>Enables protection so that calls to - <code>java.awt.Toolkit.getDefaultToolkit()</code> triggered by a web - application do not result in a memory leak. - Defaults to <code>false</code> because an AWT thread is launched. This - protection is disabled if running on Java 9 onwards since the leak has - been fixed for Java 9 onwards.</p> - </attribute> - <attribute name="classesToInitialize" required="false"> <p>List of comma-separated fully qualified class names to load and initialize during the startup of this Listener. This allows to pre-load classes that are @@ -229,57 +220,6 @@ side-effects. The default is <code>true</code>.</p> </attribute> - <attribute name="forkJoinCommonPoolProtection" required="false"> - <p>Enables protection so the threads created for - <code>ForkJoinPool.commonPool()</code> do not result in a memory leak. - The protection is enabled by setting the - <code>java.util.concurrent.ForkJoinPool.common.threadFactory</code> - system property. If this property is set when Tomcat starts, Tomcat will - not over-ride it even if this protection is explicitly enabled. The - default is <code>true</code>. This protection is disabled if running on - Java 9 onwards since the leak has been fixed for Java 9 onwards.</p> - </attribute> - - <attribute name="gcDaemonProtection" required="false"> - <p>Enables protection so that calls to - <code>sun.misc.GC.requestLatency(long)</code> triggered by a web - application do not result in a memory leak. Use of RMI is likely to - trigger a call to this method. A side effect of enabling this protection - is the creation of a thread named "GC Daemon". The protection uses - reflection to access internal Sun classes and may generate errors on - startup on non-Sun JVMs. The default is <code>true</code>. This - protection is disabled if running on Java 9 onwards since the leak has - been fixed for Java 9 onwards.</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 - memory leak. The thread is started the first time the - <code>LdapPoolManager</code> class is used if the system property - <code>com.sun.jndi.ldap.connect.pool.timeout</code> is set to a value - greater than 0. Without this protection, if a web application uses this - class the PoolCleaner thread will be configured with the thread's - context class loader set to the web application class loader which in - turn will trigger a memory leak on reload. Defaults to - <code>true</code>. This protection is disabled if running on Java 9 - onwards since the leak has been fixed for Java 9 onwards.</p> - </attribute> - - <attribute name="tokenPollerProtection" required="false"> - <p>Enables protection so that any token poller thread initialized by - <code>sun.security.pkcs11.SunPKCS11.initToken()</code> does not - result in a memory leak. The thread is started depending on various - conditions as part of the initialization of the Java Cryptography - Architecture. Without the protection this can happen during Webapp - deployment when the MessageDigest for generating session IDs is - initialized. As a result the thread has the Webapp class loader as its - thread context class loader. Enabling the protection initializes JCA - early during Tomcat startup. Defaults to <code>true</code>. This - protection is disabled if running on Java 9 onwards since the leak has - been fixed for Java 9 onwards.</p> - </attribute> - <attribute name="urlCacheProtection" required="false"> <p>Enables protection so that reading resources from JAR files using <code>java.net.URLConnection</code>s does not result in the JAR file @@ -289,15 +229,6 @@ case by case basis as required. Defaults to <code>true</code>.</p> </attribute> - <attribute name="xmlParsingProtection" required="false"> - <p>Enables protection so that parsing XML files within a web application - does not result in a memory leak. Note that memory profilers may not - display the GC root associated with this leak making it particularly - hard to diagnose. Defaults to <code>true</code>. This protection is - disabled if running on Java 9 onwards since the leak has been fixed for - Java 9 onwards.</p> - </attribute> - </attributes> <subsection name="JreMemoryLeakPreventionListener Examples"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org