https://issues.apache.org/bugzilla/show_bug.cgi?id=48971

           Summary: memory leak protection : stopping TimeThreads should
                    be optional and disabled by default
           Product: Tomcat 6
           Version: 6.0.24
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: sylvain.laur...@gmail.com


While investigating to write this wiki page
http://wiki.apache.org/tomcat/MemoryLeakProtection , I realized that
WebAppClassLoader.clearReferencesStopTimerThread() can have dangerous side
effects.

Indeed, if the TimerThread was spawned by some library deployed in the common
(or even JRE) classpath, then stopping it can impact other webapps still
running.
It would probably be a bug of that library to have such a thread with such a
context classloader, but we have to be realistic, we cannot fix every
third-party library (and the JRE).

In my opinion, tomcat should better play it safe in such a case, and should not
attempt by default to stop TimerThreads : it's safer to have a leak for a
stopped webapp than break running apps !

WebAppClassLoader.clearReferencesStopTimerThread() should be conditioned with
the existing boolean clearReferencesStopThreads.

see attached proposed patch.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to