21

Here is the top output which I gathered:

top output

I noticed that top shows VLC's CPU usage at more than 100%.

Can anybody please explain why top is showing those numbers? Is this a bug in top or something else?

  • It's not lying to you, because your load average is up over 4. That seems high - try restarting vlc, and do something to free up some memory first. – Paul Tomblin Mar 18 '12 at 11:43
  • Also, I see you're using compiz. Do you have a good 3d graphics card? If not, that's probably where all your CPU is going, trying to render a movie onto a 3d surface. – Paul Tomblin Mar 18 '12 at 11:45

1 Answers1

42

You are in a multi-core/multi-CPU environment and top is working in Irix mode. That means that your process (vlc) is performing a computation that keeps 1.2 CPUs/cores busy. That could mean 100%+20%, 60%+60%, etc.

Press 'I' (capital i, Shift+i) to switch to Solaris mode. You get the same value divided by the number of cores/CPUs.

  • 3
    After you switch out of Irix mode by pressing I, you can press W to save that as the default configuration if you are root. – RubyRedGrapefruit Oct 17 '12 at 13:37
  • 2
    Before you've pressed W to have saved those as def. config, you can also press 1 once or twice to get an idea of how exactly CPUs/cores are being loaded. ;) – poige Oct 20 '12 at 11:19
  • what should be concluded if we have a single core machine and top displays one of the process as 100% cpu usage. Does this means the machine is hung and no other process will get CPU time. – krishna Jul 05 '18 at 12:20
  • 1
    @krishna_oza: If that were the case then top wouldn't be able to update the list of processes anymore, cause it's a process too. 100% on a single core machine means “no other process requested any CPU time during the measuring interval” (or maybe something did, but was so quick it ended up a measuring error). Most importantly, when another process becomes active you should see that 100% value drop in top again with the other process getting the remaining share. – ntninja Oct 01 '19 at 16:21
  • Update on the comments of @AKWF & @poige: I'm not sure whether this was the case in 2012 already, but as of now (2019) top will save the configuration file to ${XDG_CONFIG_HOME:-~/.config}/procps/toprc if the W key is used when running it as regular user. – ntninja Oct 01 '19 at 16:24
  • 8
    THATS A CAPITAL i, LIKE IDIOT, FOR ME SPENDING 5 MINUTES PRESSING LOWERCASE L WONDERING WHY THE HELL IT DOESNT WORK – user433342 Oct 05 '20 at 20:28