tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rohit Kelapure <>
Subject Executor threadRenewalDelay questions
Date Wed, 26 Oct 2011 02:13:07 GMT
Dear All,

After going through the thread renewal code in
/tomcat-8.0.x/java/org/apache/tomcat/util/threads/ ,
and the bug (Improve ThreadLocal memory leak clean-up) I had the
following questions-

1. Once the thread pool has been renewed  after No. of active threads
in pool * max (threadKeepAliveTimeout, longestRequest+
threadRenewalDelay) seconds, why does the ThreadPoolExecutor still
keep paying the price of thread renewal. ?

After org.apache.tomcat.util.threads.ThreadPoolExecutor.threadRenewalDelay
is set to 1000L it never goes back to -1.  Ideally once the all the
threads in the threadpool is renewed we should revert the
threadRenewalDelay back to -1 and NOT call
in TaskQueue.poll(long, TimeUnit) or TaskQueue.take().
Is this because we are never quite sure as to when *all*  of the
threads in the pool have been renewed ?

2. Does the thread renewal approach scale under load (i.e. all threads
in the pool busy servicing requests and CPU close to 90%) ? Is it
meant for production deployments ?

3. How about threads that are servicing long running HTTP Keep-alive
connections that never let the thread return to the pool. Are these
threads renewed before the server is stopped.

Rohit Kelapure

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message