Java Thread monitoring. How to find out non daemon live threads?
Take a thread dump in VisualVM. Daemon threads have the word 'daemon
' next to the thread name.
"Default RequestProcessor" daemon prio=1 tid=101e58000 nid=0x124d86000 runnable [124d85000]
Run:
$ jstack PID | grep tid= | grep -v daemon
This will dump all the thread of a given Java PID, filter lines with thread names and filter out non-daemon ones.
Remove -v
to print daemon threads only.