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

--- Comment #10 from sylvain.laur...@gmail.com 2010-09-28 17:34:48 EDT ---
Created an attachment (id=26097)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26097)
Patch for tomcat 7 to renew threads one by one with a delay without requiring a
fair queue

I worked a little more on my patch to avoid requiring a fair queue. I actually
reused part of my very first patch (the Listener). Basically here is what is
done :

- idle threads are stopped all at once, even core pool threads. This is done by
ThreadLocalLeakPreventionListener
- like my previous patch, active threads are stopped one by one with a delay.

All in all, this avoids performance impacts under load since only idle threads
will be stopped as a whole, and other threads will be renewed slowly.

This memory leak protection is not 100% deterministic since one could think of
scenarios where the load decreases just after a leaking context is stopped, so
that some (core pool) threads are no longer used but still present in the pool
and thus triggering the memory leak...
But it's a compromise between performance impacts and the duration of the
memory leak.

I'd be glad to have some feedback on this 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