Finding the cause for waiting/sleeping threads Finding the cause for waiting/sleeping threads multithreading multithreading

Finding the cause for waiting/sleeping threads


On tomcat, they're usually request worker threads waiting for someone to connect.Nothing to worry about. They're ready to handle those 100 users connecting at once to your server.


Those threads are part of a ThreadPool. More specificaly java.util.concurrent.ThreadPoolExecutor. The thread is waiting on a Runnable/Callable to be submitted to the pool. For example

ExecutorService e = Executors.newFixedThreadPool(10);

Will create 10 threads that will sit an wait until

e.submit(new Runnable(){  public void run(){ ...}});

Then one thread will be notified and invoke that runnable. What they are being used for I cannot tell. You'll have to find out what started the thread pool. Maybe its handling client requests to the application server.