*BSD News Article 92018


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!not-for-mail
From: Phillip Musumeci <phillip@mirriwinni.cse.rmit.edu.au>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Swap and Memory Problems
Date: 27 Mar 1997 15:02:31 +1100
Organization: Computer Systems Engineering Department, RMIT Australia
Lines: 53
Message-ID: <87hghyc78o.fsf@mirriwinni.cse.rmit.edu.au>
References: <3339BF91.167EB0E7@silas.cc.monash.edu.au>
NNTP-Posting-Host: pm.cse.rmit.edu.au
X-Newsreader: Gnus v5.3/Emacs 19.34
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:37796

Chooka <dhenshaw@silas.cc.monash.edu.au> writes:

> I've been running into some memory and swap problems lately.

I suggest you install a package such as top and start watching what your
system is doing with regard to swap etc.  This might help.

> How can I add more swap space to overcome this problem ?
> I've tried vnconfig and swapon...but I can't figure it out ?

If you are using a FreeBSD version such as 2.2 (and maybe others - I can't
check which version and you don't say), then edit the section of file
/etc/sysconfig which sets the swapfile variable (the name of the extra
swapfile).  During boot up, script /etc/rc uses this with the vnconfig
command and swapon command to enable the extra swap space (this is a good
example of how to do it manually).

I've included the instructions from the on-line FAQ which also shows you
how to create the swap file.

phillip

---------------------------------------------------------------------------
6.2. How can I add more swap space?                                        

   The best way is to increase the size of your swap partition, or take
   advantage of this convenient excuse to add another disk (and see this
   note if you do), but Werner Griessl has provided these instructions
   for setting FreeBSD up for swapping to a file:
          
   Here is an example for 64Mb vn-swap (/usr/swap0)                

    1. create a vn-device                                      
cd /dev; sh ./MAKEDEV vn0

    2. create a swapfile (/usr/swap0)
dd if=/dev/zero of=/usr/swap0 bs=1024k count=64

    3. put into /etc/rc.local the line                               
vnconfig -ce /dev/vn0c /usr/swap0 swap                            

    4. reboot the machine                                            

   You must also have a kernel with the line                   
       
pseudo-device   vn   #Vnode driver (turns a file into a device)

   in your config-file.                                                

---------------------------------------------------------------------------

UNIX _IS_ user friendly.  It's just selective about who its friends are.
                                                                  --unknown