I am troubleshooting a shutdown that is not as graceful as it should be, so I would like to get a list of running non-daemon threads in jvisualvm (or other) to hunt the culprit.
Asked
Active
Viewed 2,015 times
6
-
1You can just press ctrl+break to get a listing of all running threads with addtional information - not the most comfortable tool but guaranteed to work and does what you need. – Voo Jan 24 '12 at 09:31
-
1Thanks! (note to myself: it is `ctrl-\' on Linux) – Rom1 Jan 24 '12 at 09:42
1 Answers
1
jstack dumps all threads, there is a text that would tell if it is daemon or not
( jvisualvm produces same output in 'ThreadDump'- See this link for more useful documentation
"Reference Handler" daemon prio=10 tid=0x00a98400 nid=0x1ee8 in Object.wait() [0x00b6f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:485)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
- locked <0x19835fa0> (a java.lang.ref.Reference$Lock)
"VM Thread" prio=10 tid=0x00a95800 nid=0x264 runnable

Jayan
- 18,003
- 15
- 89
- 143