I have a big project that also use many libraries. With jstack I found that there are threads like:
Timer-2, Timer-3, Timer-4....
and all that jstack can me display is:
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.util.TimerThread.mainLoop(Unknown Source)
- locked <0x1a013c24> (a java.util.TaskQueue)
at java.util.TimerThread.run(Unknown Source)
Is it possible to find a class where these threads where created?
Yes, it will create new threads.
The timer isn't a thread BUT having a timer fire events asynchronously can be regarded as a form of multi-threading - along with all the traditional multi-threading issues!
The Timer threads are created by the java.util.Timer.
If you are able to use the debugger you should be able to set a breakpoint in the Timer constructors and find out the source.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With