0

I am troubleshooting a JOGL application shutdown. As the application is not terminating properly, I would like to know which of the threads is causing this. Is there a way to check in the debugger which threads are non-daemon ones?

enter image description here

If there is nothing in the IDE for this, is there some other way to check for this, perhaps some clever expression I could enter as a watch expression to list the non-deamon threads?

Suma
  • 33,181
  • 16
  • 123
  • 191
  • Note: an issue exists to add the support into the debugger: https://youtrack.jetbrains.com/issue/IDEA-132042 – Suma Dec 05 '18 at 11:42

2 Answers2

3

If you can put break point you can use call Evaluate expression (Alt + F8) and type Thread.getThreads() the you can inspect every thread if it's deamon.

Ulad
  • 1,083
  • 8
  • 17
1

Right click on a stack frame and click "Export Treads...". It will create a text description of every thread and their stack and stuff but most importantly the daemon threads will say "daemon" next to them.

"RMI Scheduler(0)@4275" daemon prio=5 tid=0x14 nid=NA waiting
  java.lang.Thread.State: WAITING
      at jdk.internal.misc.Unsafe.park(Unsafe.java:-1)
      at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
...
user988346
  • 1,799
  • 3
  • 16
  • 15