Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Dec 2005 13:08:14 +0100
From:      =?windows-1252?Q?Bj=F6rn_K=F6nig?= <bjoern.koenig@spray.se>
To:        Kiffin Gish <kiffin.gish@planet.nl>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Memory upgrade and resizing the /swap partition ...
Message-ID:  <43B12EAE.4040808@spray.se>
In-Reply-To: <000a01c60ada$0b76c840$2401a8c0@XGISH>
References:  <000a01c60ada$0b76c840$2401a8c0@XGISH>

next in thread | previous in thread | raw e-mail | index | archive | help
Kiffin Gish schrieb:
> I just upgraded my laptop from 512MB to 1024MB memory.
> 
> It is said that the /swap partition has to be at least as much as the maximum available memory, [...]

This is more an ancient rule of thumb. You can even have a working 
system without swap at all. Swap will be only used if you have to less 
memory available and it depends on the main purpose of the computer how 
much swap you need. For example I have a small server at home that acts 
as small web server, mail server, file server and many other things; the 
server has 768 MB RAM and 128 MB swap and ran for the last two years 
without "out of memory" failures.

> Can I increase the size of the existing swap partition or do I have to create a new one? [...]

There is another solution: you can use a file that extends your swap 
partition.

# create an empty 256 MB file
dd if=/dev/zero of=/usr/swapfile bs=1024k count=256

# add an appropriate line to rc.conf
echo 'swapfile="/usr/swapfile"' >> /etc/rc.conf

# add swap
/etc/rc.d/addswap start

'swapinfo' shows information about your current swap partition and files.

Regards
Björn



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