简体   繁体   English

I/O 操作中 CPU 使用率 100%

[英]CPU usage 100% in I/O operaitions

I have a theoretical question about CPU usage.我有一个关于 CPU 使用率的理论问题。 When the CPU usage goes to 100%, what does it mean ?当 CPU 使用率达到 100% 时,这意味着什么? Does this mean, I have too large data ?这是否意味着我的数据太大? Or does this mean I have too large files ?或者这是否意味着我的文件太大? Or too large number of files ?还是文件数量过多? or too much data on JVM ?或者 JVM 上的数据太多?

This is Java I/O operation done using Multi threaded application.这是使用多线程应用程序完成的 Java I/O 操作。

It means that your application makes more computations than what your CPU can manage such that your CPU is totally overloaded, proportionally it doesn't do much IO compared to computations because IO adds some latency that will consequently reduce the CPU usage, for example an infinite loop with no pause will consume 100 % of the affected CPU .这意味着您的应用程序进行的计算比您的CPU可以管理的更多,以至于您的CPU完全过载,与计算相比,它不会做太多的IO ,因为IO增加了一些延迟,从而减少了CPU使用率,例如无限没有暂停的循环将消耗100 %的受影响CPU

while(true);

While an infinite loop with a pause will consume much less CPU as we will have less computations to be done per unit of time.虽然具有暂停的无限循环将消耗更少的CPU因为我们将在单位时间内完成更少的计算。

while(true) {
    Thread.sleep(50L);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM