if you're swapping heavily, you might want to look at which processes
are sucking so much ram and decide if they're really that important.

(one way to do it:) run "top" and press "M" to sort by memory usage.
I haven't done so here, but its probably also useful to press "f" and
choose to show the "SWAP" column. here's the first few lines from mine
at the moment:

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
  575 gus       14   0 20488  19M  3968 S     0.3 32.5   0:55 xemacs
  476 root      13 -10 13476 7700  1212 S <   1.3 12.2   0:14 XFree86
  455 root       9   0  2980 2944  2808 S     0.0  4.6   0:00 apache
  461 www-data   9   0  2916 2848  2720 S     0.0  4.5   0:00 apache
  462 www-data   9   0  2916 2848  2720 S     0.0  4.5   0:00 apache
  463 www-data   9   0  2916 2848  2720 S     0.0  4.5   0:00 apache

SIZE is total size.

RSS is "resident memory" - ie: that bit that isn't out in swap, or
    some mmaped file or something. other than the xserver (see below),
    the difference between RSS and SIZE is usually the amount swapped
    out.

SHARE is the amount of that that's shared with some other process
    (usually because its code pages in a relocatable shared library)

also, if the STAT flag "W" appears, it means the process has been
entirely swapped out (or is a kernel thread).


by a happy coincidence, these processes also illustrate several
important things to consider when interpreting these numbers:

my xemacs has allocated 20M and 19M of that is in memory at the
moment. only 4M of that is shared `cos its nearly all elisp run-time
data. this is what a typical memory hog looks like ;)

XFree86 looks like its taking 13M, but its really only using 7.7M. a
large chunk of that supposed 13M memory usage is probably an mmap()ed
video card, so it isn't really taking memory away from other processes
at all (in fact, the amount claiming to be swapped out (~7M) is more
swap than i have used at the moment).

apache is taking 3M, but all the apache children are sharing nearly
all their pages, so the cumulative effect isn't as bad as it looks.

-- 
 - Gus
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to