org.apache.catalina.core

Class JreMemoryLeakPreventionListener

public class JreMemoryLeakPreventionListener extends Object implements LifecycleListener

Provide a workaround for known places where the Java Runtime environment can cause a memory leak or lock files.

Memory leaks occur when JRE code uses the context class loader to load a singleton as this will cause a memory leak if a web application class loader happens to be the context class loader at the time. The work-around is to initialise these singletons when Tomcat's common class loader is the context class loader.

Locked files usually occur when a resource inside a JAR is accessed without first disabling Jar URL connection caching. The workaround is to disable this caching by default.

Method Summary
booleanisAppContextProtection()
booleanisGcDaemonProtection()
booleanisUrlCacheProtection()
booleanisXmlParsingProtection()
voidlifecycleEvent(LifecycleEvent event)
voidsetAppContextProtection(boolean appContextProtection)
voidsetGcDaemonProtection(boolean gcDaemonProtection)
voidsetUrlCacheProtection(boolean urlCacheProtection)
voidsetXmlParsingProtection(boolean xmlParsingProtection)

Method Detail

isAppContextProtection

public boolean isAppContextProtection()

isGcDaemonProtection

public boolean isGcDaemonProtection()

isUrlCacheProtection

public boolean isUrlCacheProtection()

isXmlParsingProtection

public boolean isXmlParsingProtection()

lifecycleEvent

public void lifecycleEvent(LifecycleEvent event)

setAppContextProtection

public void setAppContextProtection(boolean appContextProtection)

setGcDaemonProtection

public void setGcDaemonProtection(boolean gcDaemonProtection)

setUrlCacheProtection

public void setUrlCacheProtection(boolean urlCacheProtection)

setXmlParsingProtection

public void setXmlParsingProtection(boolean xmlParsingProtection)
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.