Reputation: 10561
I am running a multi-thread Java application on Ubuntu. I want to watch the CPU usage.
The reading I saw from "System Monitor" is around 42% over time. Does this mean most of the CPUs is not fully utilized? I have 8 cores.
However, if I watch it in 'top' command, it shows that my Java application is using over %300 CPU (one PID).
Which reflects the true picture of my CPU utilization? I want to see whether and how my Java application benefits the threading.
Upvotes: 3
Views: 405
Reputation: 2858
By default, top on Linux runs in so-called IRIX mode.
With IRIX mode on, 1 fully utilized core is 100% and 3 cores are 300%. With IRIX mode off, 1/8 fully utilized core is 12.5%. This means in top it shows over 300% and in "System Monitor" 40%.
You can toggle IRIX mode while top is running with Shift+i. This will make the numbers match up.
Upvotes: 4