On 28/03/2010 19:46, Steffen Heil wrote: > Hi > > You wrote, that when an application is unloaded, that tomcat discards all > references to the classes of that web application, therefore the garbage > collector could effectively "unload" that application. > > However, there are web applications that have own threads (file reaper, > connection pool, etc.). > > That means that there is no real way to safely unload a web application. > > I am thinking about a strategy to iterate over all running threads and > interrupt (and if absolutely necessary stop) all threads started by a > certain classloader (not sure if it is possible, but I suspect so - might > require instrumention though.)
Tomcat can already do this. You don't want to use it though. In my testing the JVM crashed about 50% of the time. Better to fix the thread leak. Tomcat will also tell you which threads weren't stopped along with a bunch of other memory leak checks. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org