daemon threads in java
i ran jconsole, i see some live threads count and daemon threads count .... i run no other java app/classes .... i c开发者_如何学编程ould see the list of live threads but not daemon thread .... is there a way to know what is the list of deamon threads ?
You can create a thread dump (using the jstack
tool), which will show for each thread whether it is a daemon or not.
Instead of using jstack
on the command line, you can also trigger a thread dump using visualvm (http://visualvm.dev.java.net), and look at the threads over time.
The daemon are included in live threads.
Both in the counter and list.
I don't think jconsole has an option to show only daemon threads.
Must of the "built-in" if not all but the "main" thread are daemon threads.
精彩评论