How to find the source of the timer stream?

I have a big project that also uses many libraries. With jstack, I found that there are topics such as:

Timer-2, Timer-3, Timer-4.... 

and all jstack can show 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 the class where these threads were created?

+8
java multithreading timer
source share
2 answers

Timer streams are created using java.util.Timer .

If you can use the debugger, you must set a breakpoint in the Timer constructors and find out the source.

+2
source share

Run the code in the debugging environment and place the breakpoint in the Thread constructors.

+1
source share

All Articles