From owner-freebsd-hackers Wed Oct 8 06:54:34 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id GAA18404 for hackers-outgoing; Wed, 8 Oct 1997 06:54:34 -0700 (PDT) (envelope-from owner-freebsd-hackers) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id GAA18397 for ; Wed, 8 Oct 1997 06:54:31 -0700 (PDT) (envelope-from root@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id GAA19466; Wed, 8 Oct 1997 06:56:13 -0700 (PDT) Message-Id: <199710081356.GAA19466@implode.root.com> To: Gordon Henderson cc: hackers@FreeBSD.ORG Subject: Re: Wheres all my memory going? In-reply-to: Your message of "Wed, 08 Oct 1997 13:55:54 BST." From: David Greenman Reply-To: dg@root.com Date: Wed, 08 Oct 1997 06:56:13 -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Machine boots OK. I start named (8.1.1) and it initialises. However, after >some time (a day or so) the machine start to run out of swap space. I only >allocated 64M of swap. (Is this the problem?) What I can't figure out is >where the memory is going. Output of 'top -b' shows: Yes, you need more swap than you have RAM...this is very important to avoid problems. >Mem: 242M Active, 50M Inact, 26M Wired, 34M Cache, 1726K Buf, 152M Free >Swap: 64M Total, 53M Used, 11M Free, 83% Inuse ... >And that just does now add up!!! (Yes, named is supposed to be that large, >but it's no-where near the total memory of the machine) Sure it does, but the numbers mean something different from how you're interpreting them. "Active" and "Inact" pages are pages that are either part of processes _or_ cached files. "Wired" memory is memory that the kernel has allocated internally, most of which is probably for networking buffers (you apparantly have or had a large number of active TCP connections?). "Cache" pages are second-chance cached file data; "Buf" is memory allocated to filesystem buffers; and "Free" is completely unused memory. 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. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project