From owner-freebsd-hackers Wed Oct 8 10:16:25 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA01680 for hackers-outgoing; Wed, 8 Oct 1997 10:16:25 -0700 (PDT) (envelope-from owner-freebsd-hackers) Received: from dyson.iquest.net (dyson.iquest.net [198.70.144.127]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id KAA01673 for ; Wed, 8 Oct 1997 10:16:19 -0700 (PDT) (envelope-from toor@dyson.iquest.net) Received: (from root@localhost) by dyson.iquest.net (8.8.6/8.8.5) id MAA01894; Wed, 8 Oct 1997 12:16:05 -0500 (EST) From: "John S. Dyson" Message-Id: <199710081716.MAA01894@dyson.iquest.net> Subject: Re: Wheres all my memory going? In-Reply-To: from Gordon Henderson at "Oct 8, 97 03:12:16 pm" To: gordon@drogon.net (Gordon Henderson) Date: Wed, 8 Oct 1997 12:16:05 -0500 (EST) Cc: hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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 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