From owner-freebsd-hackers Thu Sep 4 07:07:33 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id HAA00134 for hackers-outgoing; Thu, 4 Sep 1997 07:07:33 -0700 (PDT) Received: from word.smith.net.au (word.smith.net.au [202.0.75.3]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id HAA00127 for ; Thu, 4 Sep 1997 07:07:27 -0700 (PDT) Received: from word.smith.net.au (localhost.smith.net.au [127.0.0.1]) by word.smith.net.au (8.8.7/8.8.5) with ESMTP id XAA01388; Thu, 4 Sep 1997 23:36:03 +0930 (CST) Message-Id: <199709041406.XAA01388@word.smith.net.au> X-Mailer: exmh version 2.0zeta 7/24/97 To: Brian Campbell cc: freebsd-hackers@FreeBSD.ORG Subject: Re: 2.2-stable swap usage? In-reply-to: Your message of "Thu, 04 Sep 1997 00:08:12 -0400." <19970904000812.60761@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 04 Sep 1997 23:36:02 +0930 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Mike Smith said: > > The simple answer is that once swap is allocated to a process, it is > > never freed. You have, in the case above, 24M worth of text which at > > some stage has been swapped out, and thus has had swap allocated to it. > > It doesn't mean you have 24M worth of swap currently "in use". > > John S. Dyson wrote: > > Once the pages in MFS or any other process are paged out, those pages will be > > persistant in swap until the process exits (or the memory is explicitly > > deallocated by the process.) > > Ok. So, contrary to what Mike Smith says, pages that belonged to > a process that has since exited will no longer be marked in-use by > swap? I didn't say that; I said once it's been given to a process, it's never taken back. If it's backing memory that the process has freed, it will be returned. Once the process exits, naturally swap will be freed; the system would starve without this. > If they are still marked "in-use", is there a program other than > pstat that gives a more accurate picture of how many [active] pages > are in swap? That'd be horrifically difficult to determine at any given point in time. You could look at the figures given by 'systat -vmstat' and in particular the amount of "active" memory, but how you go about deciding what is in use by processes as opposed to by the buffer cache is not clear. > > MFS doesn't deallocate any of it's memory usage. > > So, if 90% of MFS is consumed by files which are later unlinked > (and not in use by any process), is swap thereafter limited to 10% > of its original size? That sounds reasonable. mike