| Package | Description |
|---|---|
| se.jiderhamn.classloader.leak.prevention | |
| se.jiderhamn.classloader.leak.prevention.cleanup |
| 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,ClassLoaderPreMortemCleanUp> |
ClassLoaderLeakPreventorFactory.cleanUps
Map from name to
ClassLoaderPreMortemCleanUps with all the actions to invoke to make a
ClassLoader ready for Garbage Collection. |
| Modifier and Type | Method and Description |
|---|---|
<C extends ClassLoaderPreMortemCleanUp> |
ClassLoaderLeakPreventorFactory.getCleanUp(Class<C> clazz)
Get instance of
ClassLoaderPreMortemCleanUp for further configuring. |
<C extends ClassLoaderPreMortemCleanUp> |
ClassLoaderLeakPreventorFactory.removeCleanUp(Class<C> clazz)
Get instance of
ClassLoaderPreMortemCleanUp for further configuring |
| Modifier and Type | Method and Description |
|---|---|
void |
ClassLoaderLeakPreventorFactory.addCleanUp(ClassLoaderPreMortemCleanUp classLoaderPreMortemCleanUp)
Add a new
ClassLoaderPreMortemCleanUp, using the class name as name |
void |
ClassLoaderLeakPreventorFactory.addCleanUp(String name,
ClassLoaderPreMortemCleanUp classLoaderPreMortemCleanUp)
Add a new named
ClassLoaderPreMortemCleanUp |
| Constructor and Description |
|---|
ClassLoaderLeakPreventor(ClassLoader leakSafeClassLoader,
ClassLoader classLoader,
Logger logger,
Collection<PreClassLoaderInitiator> preClassLoaderInitiators,
Collection<ClassLoaderPreMortemCleanUp> cleanUps) |
| Modifier and Type | Class and Description |
|---|---|
class |
ApacheCommonsLoggingCleanUp
Release this classloader from Apache Commons Logging (ACL) by calling
LogFactory.release(getCurrentClassLoader());
Use reflection in case ACL is not present. |
class |
BeanELResolverCleanUp
Clean for the cache of
javax.el.BeanELResolver, which leaks prior to version 2.2.4. |
class |
BeanIntrospectorCleanUp
Clear
Introspector cache |
class |
BeanValidationCleanUp
Clean up leak caused by cache in
javax.validation.Validation |
class |
DefaultAuthenticatorCleanUp
Clear the default
Authenticator (in case current one is loaded by protected ClassLoader). |
class |
DriverManagerCleanUp
Deregister JDBC drivers loaded by classloader
|
class |
GeoToolsCleanUp
Shutdown GeoTools cleaner thread as of https://osgeo-org.atlassian.net/browse/GEOT-2742
|
class |
IIOServiceProviderCleanUp
Unregister ImageIO Service Provider loaded by the protected ClassLoader
|
class |
IntrospectionUtilsCleanUp
Clear IntrospectionUtils caches of Tomcat and Apache Commons Modeler
|
class |
JacksonCleanUp
Clear Jackson TypeFactory cache as per https://github.com/FasterXML/jackson-databind/issues/1363
|
class |
JavaServerFaces2746CleanUp
Workaround for leak caused by Mojarra JSF implementation if included in the container.
|
class |
JavaUtilLoggingLevelCleanUp
Cleanup for removing custom
Levels loaded within the protected class loader. |
class |
JceSecurityCleanUp
Clean up for the static caches of
JceSecurity |
class |
JDK8151486CleanUp
Clear the "domains" field of the parent ClassLoader.
|
class |
KeepAliveTimerCacheCleanUp
Since Keep-Alive-Timer thread may have terminated, but still be referenced, we need to make sure it does not
reference this classloader.
|
class |
MBeanCleanUp
Unregister MBeans loaded by the protected class loader
|
class |
MoxyCleanUp
Cleanup for leak caused by EclipseLink MOXy
See https://bugs.eclipse.org/bugs/show_bug.cgi?
|
class |
MultiThreadedHttpConnectionManagerCleanUp
Invokes static method org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.shutdownAll() to close connections left out by com.sun.jersey.client.apache.ApacheHttpClient.
|
class |
MXBeanNotificationListenersCleanUp
Unregister MBeans, MXBean
NotificationListeners/NotificationFilters/handbacks loaded by the
protected class loader |
class |
PropertyEditorCleanUp
Deregister custom property editors.
|
class |
ProxySelectorCleanUp
If default
ProxySelector is loaded by protected ClassLoader it needs to be unset |
class |
ReactorNettyHttpResourcesCleanUp
Clean up Reactor Netty resources
|
class |
ResourceBundleCleanUp
Clean up caches in
ResourceBundle |
class |
RmiTargetsCleanUp
Heavily inspired by org.apache.catalina.loader.WebappClassLoader.clearReferencesRmiTargets()
|
class |
SAAJEnvelopeFactoryParserPoolCleanUp
Clean up leak caused by
SAXParser attribute/property being loaded by protected class loader
and cached in com.sun.xml.internal.messaging.saaj.soap.EnvelopeFactory#parserPool. |
class |
SecurityProviderCleanUp
Deregister custom security providers
|
class |
ShutdownHookCleanUp
Find and deregister shutdown hooks.
|
class |
StopThreadsCleanUp
Check if there are threads running within the protected
ClassLoader, or otherwise referencing it,
and either warn or stop those threads depending on settings. |
class |
ThreadGroupCleanUp
Destroy any
ThreadGroups that are loaded by the protected classloader |
class |
ThreadGroupContextCleanUp
Clean all
ThreadGroupContext.beanInfoCaches in ThreadGroupContext.contexts
since they may contain beans/properties loaded in the protected classloader. |
class |
ThreadLocalCleanUp
Clear
ThreadLocals for which ThreadLocal.remove() has not been called, in case either the
ThreadLocal is a custom one (subclassed in the protected ClassLoader), or the value is loaded by (or is)
the protected ClassLoader. |
class |
WarningThreadLocalCleanUp
ClassLoaderPreMortemCleanUp that does not clear ThreadLocals to remove the leak, but only logs a
warning |
class |
X509TrustManagerImplUnparseableExtensionCleanUp
sun.security.ssl.X509TrustManagerImpl keeps a list set of trusted certs, which may include
sun.security.x509.UnparseableExtension that in turn may include an Exception with a backtrace
with references to the classloader that we want to protect |
Copyright © 2019. All rights reserved.