java threadump significance of "waiting on condition"

6.5k Views Asked by At

I have a threaddump of an app which showed 3 threads like below.

===============

"http-443-11" daemon prio=10 tid=0x00000000473bc800 nid=0x3590 waiting on condition [0x0000000061818000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x00000007612a3880> (a java.util.concurrent.Semaphore$NonfairSync)

"http-443-4" daemon prio=10 tid=0x00000000451f6000 nid=0x243a waiting on condition [0x0000000055354000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x00000007612a3880> (a java.util.concurrent.Semaphore$NonfairSync)

"http-443-7" daemon prio=10 tid=0x000000004602e000 nid=0x2974 waiting on condition [0x000000005e6e7000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x00000007612a3880> (a java.util.concurrent.Semaphore$NonfairSync)

===============

What is the significance of the "waiting on condition []" ? What does the number in the [] signifiy ?

1

There are 1 best solutions below

1
Vineet Kasat On

In the thread stack we can see that threads are daemon threads and are waiting for task to come. Since these threads are created on JVM startup , they dont get killed unless JVM exits or any non daemon thread i not running, thus they wait for tasks to come. Say Garbage collection thread is a daemoon thread which might not be running all the time, it could be in waiting state.