*BSD News Article 69384


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!news.mel.connect.com.au!munnari.OZ.AU!news.hawaii.edu!ames!usenet.kornet.nm.kr!usenet.etri.re.kr!news.kreonet.re.kr!bofh.dot!usenet.seri.re.kr!bofh.dot!news.cais.net!bofh.dot!news.mathworks.com!fu-berlin.de!news.dfn.de!news.ruhr-uni-bochum.de!news.uni-stuttgart.de!uni-regensburg.de!newsserv.uni-bayreuth.de!news.tu-chemnitz.de!irz401!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Linux vs. FreeBSD ... (FreeBSD extremely mem/swap hungry)
Date: 24 May 1996 21:46:05 GMT
Organization: Private BSD site, Dresden
Lines: 46
Message-ID: <4o5amt$n9l@uriah.heep.sax.de>
References: <3188C1E2.45AE@onramp.net> <4mnsc5$6qo@sundial.sundial.net>
  <4mr1pk$cdi@dyson.iquest.net> <4n0dhd$cff@agate.berkeley.edu>
  <3194622D.41C67EA6@ami-chan.res.cmu.edu> <31A52667.794BDF32@zeus.co.uk>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.6
X-Phone: +49-351-2012 669
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E

Damian Reeves <damian@zeus.co.uk> wrote:

> On replacing with BSD, and copying over the .xsession files etc., by the
> time the Xserver and xterms have started, 50MB of swap is in use!!!
> I had to increase the swap space upto 250Mb just so we could actually
> compile our server code.

Funny, my swap partition is really fat with its 120 or so meg... and
i've never seen it to overflow.

Indeed, FreeBSD does a large amount of preemptive swapping, just in
order to have free memory in case it will be needed.  (The pages are
still around in the physical memory, so if you need them back later,
they can be reclaimed, and won't be read from swap -- but the swap is
allocated already nevertheless.)  This improves the response time in
some circumstances.

>  At the moment, the machine is sitting there
> with 1 user logged in, emacs, netscape and a couple of shells. top
> reports that 59% of the swap space is in use!  top also reports that
> only 860k is available for buffer cache, ...

FreeBSD minimizes the amount of ``free memory''.  This is nothing that
should alarm you.  The used memory will keep buffer cache (from
previously accessed files) and other old data that can easily be
reclaimed when needed.  OTOH, due to the preemptive swapping, the
pages can easily be freed up for other purpose once they are needed.

Actually, a large amount of free memory (except right after system
boot) might be considered wasteful as well. :-)

> over 1200k.  This is extremely different to under linux, where it used
> to stay around 12Mb-15Mb under use.


One _known_ problem with X11 applications under FreeBSD was that the
old BSD malloc() was rather wasteful with its VM usage, and at some
point back, XFree86 didn't link against gnumalloc.  However, the
malloc has been rewritten from scratch since to overcome this.

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)