Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Leak cause

Detected by tomcat

Fixed by tomcat

Possible enhancements

Custom ThreadLocal class

>=6.0.24

>=6.0.24

Detect child classloaders, improve thread safety

Webapp class instance as ThreadLocal value

>=6.0.24

>=6.0.24

Detect child classloaders, improve thread safety

Webapp class instance indirectly held through a ThreadLocal value

no

no

Renew threads in the worker pool

ThreadLocal pseudo-leak

>=6.0.24

>=6.0.24

improve thread safety

ContextClassLoader / Threads spawned by webapps

>=6.0.24

TimerThread are stopped. Other threads may be stopped if clearReferencesStopThreads is set to true on the Context

Detect child classloaders, don't stop TimerThread by default

ContextClassLoader / Threads spawned by classes loaded by the common classloader

>=6.0.24

TimerThread are stopped. Other threads may be stopped if clearReferencesStopThreads is set to true on the Context

Detect child classloaders, don't stop TimerThread by default

ContextClassLoader / Threads spawned by JRE classes

no

>=6.0.24 pre-spawns some known offenders

 

static class variables

no

> 6.0.?

 

LogFactory

 

> 6.0.?

 

JDBC driver registration

> 6.0.?

> 6.0.?

 

RMI Target

 

> 6.0.?

 

...

So the leak is fixed, but unfortunately there's a side effect : it broke webapp B eviction timer.

(TODO: file a bug report to make the clearReferencesStopTimerThread optional and disabled by default)

Note: as of 6.0.24, by default tomcat stops threads of class java.util.TimerThread whose context classloader is the WebAppClassLoader of the app being stopped. It does not stop other threads, it only warns about them. It can try to stop them if the clearReferencesStopThreads option of the standard context is set to true.

...

  • Anchor
    48837
    48837
    48837 - Memory leaks protection does not cure leaks triggered by JSP pages code
  • Anchor
    48895
    48895
    48895 - WebAppClassLoader.clearThreadLocalMap() concurrency issues
  • Anchor
    48971
    48971
    48971 - memory leak protection : stopping TimerThreads should be optional and disabled by default