*BSD News Article 64912


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!inferno.mpx.com.au!news.unimelb.EDU.AU!munnari.OZ.AU!news.ecn.uoknor.edu!qns3.qns.com!imci4!newsfeed.internetmci.com!uwm.edu!news.inap.net!news1!not-for-mail
From: root@dyson.iquest.net (John S. Dyson)
Subject: Re: FreeBSD a memory hog ?
X-Nntp-Posting-Host: dyson.iquest.net
Message-ID: <4jsvbv$6ph@dyson.iquest.net>
Keywords: FreeBSD, memory usage
Sender: news@iquest.net (News Admin)
Organization: John S. Dyson's Machine
References: <dkleinh.828415914@isotope.ps.uci.edu>
Date: Wed, 3 Apr 1996 04:38:23 GMT
Lines: 43

In article <dkleinh.828415914@isotope.ps.uci.edu>,
Dirk Kleinhesselink <dkleinh@isotope.ps.uci.edu> wrote:
>    I am running FreeBSD 2.1 on a P-100 with 16MB ram and 16MB swap.  When I
>run netscape, after awhile, netscape is killed by the kernel with the message
>that the swap space is exhausted.  I also have Linux and I have never had
>netscape crash due to insufficient memory on Linux.  I have the same amount
>of swap when I run Linux and about the same number of processes.  I thought
>FreeBSD had better memory management than Linux.  I used to run Linux with
>only 8-MB ram and never had it kill netscape.  Where is all the memory going ?
>
It wouldn't be quite correct to say that FreeBSD is a memory hog, but there
are some problems with the way that the X-server grows.  FreeBSD tends to
push more unused pages out to disk than many other OSes (this actually frees
memory for more efficient use.)  The VM system is very very fast and efficient.
It was not tuned for minimal swap space usage, but for generally larger
machines with heavy loads.  The assumption is that you should expect every
page that you use will need to be paged out.

Other issues:

The user-mode BSD malloc is less VM space efficient than almost any other that
I know of.  If you relink the X server with phkmalloc (the version in -stable
and -current) or gnumalloc, you'll probably see an improvement.  Unfortunately,
the Netscape binary is probably built with BSD malloc anyway.

I would suggest that running X with Netscape and a minimal complement
of apps, you should have about 30MB of VM space or more.  When I was running
in 20MB, I would typically run 7MB of swap with X/Netscape.

Easy formula (not quite accurate, but a good rule of thumb):

Calculate VM space as swap space only, and swap space should be at least twice
the size of main memory.  So, you should probably have:

	max(2*8MB, 30MB) of swap.

Note that the system is more forgiving than what I imply, but things don't
always work in an ideal fashion, and you might need some headroom to run
additional apps.

John
dyson@freebsd.org