I am using a networking library which uses a thread pool for delegating tasks to specialized request handlers. In the logs of the library I see the following:
[05.03.2010 16:11:27] [pool-3-thread-9] DEBUG ...
[05.03.2010 16:11:27] [pool-1-thread-447] DEBUG ......
[05.03.2010 16:11:27] [pool-1-thread-447] DEBUG ....
[05.03.2010 16:11:27] [pool-1-thread-440] DEBUG ..
Thread IDs are slowly rising, however memory usage is consistent. Does this mean that a cached thread pool is in use here? That’s a fairly big Thread ID, I hope it doesn’t mean there’s over 400 idle/working threads in the application.
In the Java source for
Threadthere is the following code:This number is used by the Thread constructor, when users don’t specify a name. They do not reuse numbers for terminated/finished threads.
So when memory consumption is equal: it definitely means older Threads are not (fully) reused but terminated or finished.