我使用 jstack 来输出线程信息。还有一个线程: “虚拟机线程”prio=10 tid=0x0878b400 nid=0x760a 可运行
这个线程是用来做什么的? 它占用 50% 的 CPU 使用率和大部分 CPU 时间
最佳答案
VM线程定义here作为:
This thread waits for operations to appear that require the JVM to reach a safe-point. The reason these operations have to happen on a separate thread is because they all require the JVM to be at a safe point where modifications to the heap can not occur. The type of operations performed by this thread are "stop-the-world" garbage collections, thread stack dumps, thread suspension and biased locking revocation.
在去重复的 SO 答案中也提供了一些信息 here .
关于java - java "VM thread"是做什么的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3895940/