I am trying to understand what the "cpu" and "elapsed" fields mean in a jstack thread dump in java 11. I have the following details for a thread, where jstack was executed three times quickly:
"Thread 1 " daemon prio=5 os_prio=0 cpu=0.13ms elapsed=51.03s tid=0x00007fe9c4024000 nid=0x2c11 waiting on condition [0x00007fe500284000]
java.lang.Thread.State: TIMED_WAITING (parking)
"Thread 1 " daemon prio=5 os_prio=0 cpu=0.13ms elapsed=56.96s tid=0x00007fe9c4024000 nid=0x2c11 waiting on condition [0x00007fe500284000]
java.lang.Thread.State: TIMED_WAITING (parking)
"Thread 2" daemon prio=5 os_prio=0 cpu=0.10ms elapsed=1.35s tid=0x00007fe9c4024000 nid=0x2da1 waiting on condition [0x00007fe4a0311000]
java.lang.Thread.State: TIMED_WAITING (parking)
After TIMED_WAITING, rest of the message is exactly same in all the three threads. My question is, why does elapsed time suddenly decrease on the third 1, even when tid is the same? In my application, thread name keeps changing, so it doesn't necessarily imply that a different thread name corresponds to a different thread. Can it happen that the old thread died and the same tid was quickly reused? If someone could link any official doc on the explanation of the dump, that would be helpful. (NOTE: My threads belong to a thread pool)
I could only find the cpu and elapsed explanation at https://bugs.openjdk.org/browse/JDK-8200720. But doesn't really help.