| Package | Description |
|---|---|
| se.jiderhamn.classloader.leak.prevention | |
| se.jiderhamn.classloader.leak.prevention.preinit |
| Modifier and Type | Class and Description |
|---|---|
class |
ReplaceDOMNormalizerSerializerAbortException
As reported at https://github.com/mjiderhamn/classloader-leak-prevention/issues/36, invoking
DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument().normalizeDocument(); or
Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
DOMImplementationLS implementation = (DOMImplementationLS)document.getImplementation();
implementation.createLSSerializer().writeToString(document);
may trigger leaks caused by the static fields com.sun.org.apache.xerces.internal.dom.DOMNormalizer#abort and
com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl#abort respectively keeping stacktraces/backtraces
that may include references to classes loaded by our web application. |
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,PreClassLoaderInitiator> |
ClassLoaderLeakPreventorFactory.preInitiators
Map from name to
PreClassLoaderInitiators with all the actions to invoke in the
ClassLoaderLeakPreventorFactory.leakSafeClassLoader. |
| Modifier and Type | Method and Description |
|---|---|
<C extends PreClassLoaderInitiator> |
ClassLoaderLeakPreventorFactory.getPreInitiator(Class<C> clazz)
Get instance of
PreClassLoaderInitiator for further configuring. |
<C extends PreClassLoaderInitiator> |
ClassLoaderLeakPreventorFactory.removePreInitiator(Class<C> clazz)
Get instance of
PreClassLoaderInitiator for further configuring |
| Modifier and Type | Method and Description |
|---|---|
void |
ClassLoaderLeakPreventorFactory.addPreInitiator(PreClassLoaderInitiator preClassLoaderInitiator)
Add a new
PreClassLoaderInitiator, using the class name as name |
| Constructor and Description |
|---|
ClassLoaderLeakPreventor(ClassLoader leakSafeClassLoader,
ClassLoader classLoader,
Logger logger,
Collection<PreClassLoaderInitiator> preClassLoaderInitiators,
Collection<ClassLoaderPreMortemCleanUp> cleanUps) |
| Modifier and Type | Class and Description |
|---|---|
class |
AwtToolkitInitiator
The first call to java.awt.Toolkit.getDefaultToolkit() will spawn a new thread with the
same contextClassLoader as the caller.
|
class |
DatatypeConverterImplInitiator
DatatypeConverterImpl in the JAXB Reference Implementation shipped with JDK 1.6+ will
keep a static reference (DatatypeConverterImpl) to a concrete subclass of
DatatypeFactory, that is resolved when the class is loaded (which I believe happens if you
have custom bindings that reference the static methods in DatatypeConverter). |
class |
DocumentBuilderFactoryInitiator
The classloader of the first thread to call DocumentBuilderFactory.newInstance().newDocumentBuilder()
seems to be unable to garbage collection.
|
class |
JarUrlConnectionInitiator
The caching mechanism of JarURLConnection can prevent JAR files to be reloaded.
|
class |
Java2dDisposerInitiator
Loading the class sun.java2d.Disposer will spawn a new thread with the same contextClassLoader.
|
class |
Java2dRenderQueueInitiator
Using the class sun.java2d.opengl.OGLRenderQueue will spawn a new QueueFlusher thread with the same contextClassLoader.
|
class |
JavaxSecurityLoginConfigurationInitiator
The class javax.security.auth.login.Configuration will keep a strong static reference to the
contextClassLoader of Thread from which the class is loaded.
|
class |
JdbcDriversInitiator
Your JDBC driver will be registered in java.sql.DriverManager, which means that if
you include your JDBC driver inside your web application, there will be a reference
to your webapps classloader from system classes (see
part II).
|
class |
LdapPoolManagerInitiator
The contextClassLoader of the thread loading the com.sun.jndi.ldap.LdapPoolManager class may be kept
from being garbage collected, since it will start a new thread if the system property
com.sun.jndi.ldap.connect.pool.timeout is set to a value greater than 0. |
class |
OracleJdbcThreadInitiator
See https://github.com/mjiderhamn/classloader-leak-prevention/issues/8
and https://github.com/mjiderhamn/classloader-leak-prevention/issues/23
and https://github.com/mjiderhamn/classloader-leak-prevention/issues/69
and http://java.jiderhamn.se/2012/02/26/classloader-leaks-v-common-mistakes-and-known-offenders/
|
class |
SecurityPolicyInitiator
javax.security.auth.Policy.getPolicy() will keep a strong static reference to
the contextClassLoader of the first calling thread.
|
class |
SecurityProvidersInitiator
Custom java.security.Provider loaded in your web application and registered with
java.security.Security.addProvider() must be unregistered with java.security.Security.removeProvider()
at application shutdown, or it will cause leaks.
|
class |
SunAwtAppContextInitiator
There will be a strong reference from
sun.awt.AppContext#contextClassLoader to the classloader of the calls
to sun.awt.AppContext#getAppContext(). |
class |
SunGCInitiator
sun.misc.GC.requestLatency(long), which is known to be called from
javax.management.remote.rmi.RMIConnectorServer.start(), will cause the current
contextClassLoader to be unavailable for garbage collection.
|
Copyright © 2019. All rights reserved.