Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are those java threads starting with "pool"?

I have a problem with a Tomcat server that is unable to shutdown gracefully. I have taken a thread dump after I issued the shutdown command, and it looks like this:

http://pastebin.com/7SW4wZN9

The thread which I believe is the "suspect" that does not allow the VM to shut down is the one named "pool-4-thread-1". The rest of them are either daemon threads or internal VM threads. While trying to find out what this thread is for, I noticed that there are other java programs out there that create threads with similar names (For example, JVisualVM creates such threads).

So I'm wondering if someone else knows what this thread is and how it can be created.

like image 686
mavroprovato Avatar asked Sep 26 '11 08:09

mavroprovato


1 Answers

These threads are probably created by an ExecutorService that you created in your code somewhere (directly or indirectly through a library) and that needs to be shutdown (for example in a ServletContextListener).

like image 92
Thilo Avatar answered Sep 25 '22 03:09

Thilo