|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.catalina.core.JreMemoryLeakPreventionListener
public class JreMemoryLeakPreventionListener
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.
Field Summary | |
---|---|
protected boolean |
appContextProtection
Protect against the memory leak caused when the first call to sun.awt.AppContext.getAppContext() is triggered by a web
application. |
protected static StringManager |
sm
|
protected boolean |
urlCacheProtection
Protect against resources being read for JAR files and, as a side-effect, the JAR file becoming locked. |
protected boolean |
xmlParsingProtection
XML parsing can pin a web application class loader in memory. |
Constructor Summary | |
---|---|
JreMemoryLeakPreventionListener()
|
Method Summary | |
---|---|
boolean |
isAppContextProtection()
|
boolean |
isUrlCacheProtection()
|
boolean |
isXmlParsingProtection()
|
void |
lifecycleEvent(LifecycleEvent event)
Acknowledge the occurrence of the specified event. |
void |
setAppContextProtection(boolean appContextProtection)
|
void |
setUrlCacheProtection(boolean urlCacheProtection)
|
void |
setXmlParsingProtection(boolean xmlParsingProtection)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final StringManager sm
protected boolean appContextProtection
sun.awt.AppContext.getAppContext()
is triggered by a web
application. Defaults to true
.
protected boolean urlCacheProtection
URLConnection
s, regardless of type. Defaults to
true
.
protected boolean xmlParsingProtection
Constructor Detail |
---|
public JreMemoryLeakPreventionListener()
Method Detail |
---|
public boolean isAppContextProtection()
public void setAppContextProtection(boolean appContextProtection)
public boolean isUrlCacheProtection()
public void setUrlCacheProtection(boolean urlCacheProtection)
public boolean isXmlParsingProtection()
public void setXmlParsingProtection(boolean xmlParsingProtection)
public void lifecycleEvent(LifecycleEvent event)
LifecycleListener
lifecycleEvent
in interface LifecycleListener
event
- LifecycleEvent that has occurred
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |