Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] CPU monitor shows 100% use, but process list shows nothing above 10%



On 20/05/07, Dave M G <martin@example.com> wrote:

1. Why is there a discrepancy between the list of processes, and the CPU
monitor (and the fact that I can hear the CPU working at maximum)?

Well, technically you are hearing the fan working at maximum speed to cool down the CPU, but... ;)

The basic problem is that you are not looking at the entire list of
processes, just the top 20 or so, sorted by whatever metric the
process monitor happens to be using at that time. If you have 100
children of your Bittorrent client, all using 0.5% CPU, that is 50%
utilisation that may well not show up on the default view of the
process monitor.

2. When this happens again is there a better way of querying what
processes are running so that I'm more likely to find the process that's
hogging the CPU?

The first thing to try is running:

free

This will show you something like this:

: jmglov@example.com; free
            total       used       free     shared    buffers     cached
Mem:        516668     179028     337640          0        296      86736
-/+ buffers/cache:      91996     424672
Swap:       500464          0     500464

Basically, you want to pay close attention to the free memory without
buffers and cache (the second line) and the swap usage line. In my
example, my box is using no swap at all. In the situation you
described, I wouldn't be surprised to see high swap usage, meaning
that the machine's physical memory is pretty full, and things are
constantly being paged in and out. Did you notice higher than usual
hard disk activity in addition to the CPU fan?

Next, open up your process monitor and start changing the sort
category. i.e. sort by CPU usage (first descending, then ascending),
memory usage, etc. In top(1), this is accomplished by pressing the ">"
and "<" keys to move the sort column and "R" to toggle normal /
reverse sort. I would assume a GNOME tool would have easier ways to
accomplish the same thing.

Finally, check the usual suspects. Exit from Firefox, OpenOffice.org,
Thunderbird, your Bittorrent client, and any other big programs, then
see if they left any wedged processes behind:

ps auxw | grep -i firefox | grep -v grep

: jmglov@example.com; ps auxw | grep -i firefox | grep -v grep
jmglov    3908  1.4 12.7 171324 65672 tty1     Sl   09:25   1:04
/usr/lib/mozilla-firefox/firefox-bin

If you see processes hanging around from an application that you just
exited, kill them. First, be nice:

kill 3908

Then, check for the process again:

ps auxw | grep -i firefox | grep -v grep

If it is still around, be forceful:

sudo kill -9 3908

And finally, if all else fails, reboot. :) Old school Unix users may
scoff, and 'tis true that a Unix system rarely *needs* a reboot, but
sometimes it can be the fastest way to return to situation normal.
Especially for a non-expert user.

HTH,
Josh


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links