java“虚拟机线程"是什么意思?做? [英] What does java "VM thread" do?

查看:14
本文介绍了java“虚拟机线程"是什么意思?做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 jstack 来输出线程信息.还有一个线程:VM 线程"prio=10 tid=0x0878b400 nid=0x760a 可运行

I use jstack to output the thread info. And there is a thread: "VM Thread" prio=10 tid=0x0878b400 nid=0x760a runnable

这个线程是用来做什么的?它占用 50% 的 CPU 使用率和大部分 CPU 时间

What is this thread used to do? It takes 50% CPU usage and most of CPU time

推荐答案

VM线程定义这里 作为:

该线程等待需要 JVM 到达安全点的操作出现.这些操作必须在单独的线程上发生的原因是因为它们都要求 JVM 处于不能对堆进行修改的安全点.该线程执行的操作类型是stop-the-world"垃圾收集、线程堆栈转储、线程挂起和偏向锁定撤销.

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 答案中还提供了一些信息 这里.

There's also some information provided in a de-duplicated SO answer here.

这篇关于java“虚拟机线程"是什么意思?做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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