- !! This page is under construction !!*
For some time Tomcat has had some means of protection against memory leaks when stopping or redeploying applications. This page tries to list them, and shows the situations where leaks can be detected and fixed.
...
Leak cause | Detected by tomcat | Fixed by tomcat | Possible enhancements |
>=6.0.24 | 6.0.24-6.0.26 but is unsafe. Made optional from 6.0.27 | ||
>=6.0.24 | 6.0.24-6.0.26 but is unsafe. Made optional from 6.0.27 | ||
Webapp class instance indirectly held through a ThreadLocal value | no | no | |
>=6.0.24 | 6.0.24-6.0.26 but is unsafe. Made optional from 6.0.27 | ||
>=6.0.24 | In 6.0.24-6.0.26 | Detect child classloaders, Fix the application to stop the thread when the application is stopped | |
ContextClassLoader / Threads spawned by classes loaded by the common classloader | >=6.0.24 | In 6.0.24-6.0.26 | Detect child classloaders, fix the offending code (set the correct CCL when spawning the thread) |
no | >=6.0.24 pre-spawns some known offenders |
| |
no | > 6.0.? . Disabled by default with tomcat 7 |
| |
| > 6.0.? |
| |
> 6.0.? | > 6.0.? |
| |
| > 6.0.? |
|
...
48837 - Memory leaks protection does not cure leaks triggered by JSP pages codeAnchor 48837 48837 Anchor 48895 48895 48895 - WebAppClassLoader.clearThreadLocalMap() concurrency issuesAnchor 48971 48971 48971 - memory leak protection : stopping TimerThreads should be optional and disabled by default
49159 - Improve ThreadLocal memory leak clean-upAnchor 49159 49159 - Sun bug 4957990 - In some cases the Server JVM fails to collect classloaders. According to this page it should have been fixed with java 6u16 but actually it was not. It seems to be fixed with 6u21 (documented here and verified by the author of this wiki page).
...