Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 Sep 1997 23:36:02 +0930
From:      Mike Smith <mike@smith.net.au>
To:        Brian Campbell <brianc@pobox.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: 2.2-stable swap usage? 
Message-ID:  <199709041406.XAA01388@word.smith.net.au>
In-Reply-To: Your message of "Thu, 04 Sep 1997 00:08:12 -0400." <19970904000812.60761@pobox.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 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





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