Java中的默认线程 [英] Default Threads in Java

查看:164
本文介绍了Java中的默认线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果代码中没有用户创建的线程,我们调用jvm时会启动多少个默认线程?我已经知道2个线程将开始,那些是

How many default Threads are started when ever we call jvm if there is no user created threads in the code ? I already Know 2 threads are going to start, those are

1)主线程(非守护线程)

1) Main thread (Non Daemon Thread)

2)垃圾收集器(守护程序线程)

2) Garbage Collector (Daemon Thread)

推荐答案

如果安装了JDK,则可以使用 jvisualvm jconsole (旧版Java)位于bin(Windows)目录中。

If you have the JDK installed you can use jvisualvm or jconsole (older versions of Java) located in the bin (Windows) directory.

该工具将允许您查看所有线程及其详细信息。

The tool will allow you to see all the threads and their details.

附加截图。

这篇关于Java中的默认线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆