Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Oct 1997 12:16:05 -0500 (EST)
From:      "John S. Dyson" <toor@dyson.iquest.net>
To:        gordon@drogon.net (Gordon Henderson)
Cc:        hackers@freebsd.org
Subject:   Re: Wheres all my memory going?
Message-ID:  <199710081716.MAA01894@dyson.iquest.net>
In-Reply-To: <Pine.LNX.3.95.971008150233.26875W-100000@unicorn> from Gordon Henderson at "Oct 8, 97 03:12:16 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Gordon Henderson said:
> On Wed, 8 Oct 1997, David Greenman wrote:
> 
> >    The bottom line is that it really isn't possible to determine precisely
> > how much memory processes are using without carefully analyzing the output
> > of 'ps' and adding up the RSS.
> 
>   UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT  TT       TIME COMMAND
>     0     0     0   0 -18  0     0    0 sched  DLs   ??    0:00.11 (swapper)
>     0     1     0   0  10  0   408   92 wait   Is    ??    0:00.03 /sbin/init -
>     0     2     0  31 -18  0     0   12 psleep DL    ??    2:33.07 (pagedaemon
>     0     3     0   0  28  0     0   12 psleep DL    ??    0:00.00 (vmdaemon)
>     0     4     0   0  28  0     0   12 update DL    ??    2:38.60 (update)
>     0    70     1   0   2  0   204  336 select Ss    ??    8:13.83 syslogd
>     0    99     1   0   2  0   192  240 select Is    ??    0:00.04 inetd
>     0   101     1   0  18  0   332  336 pause  Is    ??    0:01.40 cron
>     0   104     1  13   2  0   208  228 select Is    ??    0:00.02 lpd
>     0   287     1   9   2  0 290060  840 select Ss    ??  237:40.19 named
>     0   457     1  42   2 -12   416  456 select S<s   ??    0:10.90 xntpd
>     0  5415    99   0   2  0   168  320 select Ss    ??    0:00.32 rlogind
>  1000  5416  5415   0  18  0   444  128 pause  Is    p0    0:00.12 -csh (csh)
>     0  5426  5416   0  18  0   452  268 pause  S     p0    0:00.21 -su -m (csh)
>     0  5743  5426   1  28  0   632  268 -      R+    p0    0:00.00 ps -gaxl
>     0   144     1   0   3  0   180  224 ttyin  Is+   v0    0:00.02 /usr/libexec
>     0   148     1   0   3  0   180  224 ttyin  Is+   d0    0:00.02 /usr/libexec
>                             ============
>                             293876  3996
> 
One more hint to interpreting the RSS value: a page can be resident in memory,
and still not be included in the "RSS."  The RSS is actually an indication of
pages mapped into the process.  A page can be temporarily stolen from a process,
and be included in "Active" and not be included in RSS.

The best rule: ALWAYS make the amount of SWAP >= the amount of memory.  It is
even safer to make the amount of SWAP a multiple of the amount of memory, but
if you always have "enough" memory, then SWAP == MEMORY is okay.

Next, judge your memory sufficiency by paging activity.  If you page alot,
(and you have enough swap), then you need more memory.  If you don't page much,
then you likely have enough memory.

-- 
John
dyson@freebsd.org
jdyson@nc.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710081716.MAA01894>