Maximum Swapsize

Kris Kennaway kris at obsecurity.org
Tue Apr 11 20:25:01 UTC 2006


On Tue, Apr 11, 2006 at 10:48:08AM +0930, Daniel O'Connor wrote:
> On Tuesday 11 April 2006 01:47, Kris Kennaway wrote:
> > On Mon, Apr 10, 2006 at 06:13:07PM +0200, Michael Schuh wrote:
> > > Hello @all,
> > >
> > > last weekend i have setted up an new Machine with
> > > 6.1-Beta4. By Installation i have made an Swappartition
> > > with the size of 4GB after install in runtime in top
> > > it sseems to me that the maximum swap-size is
> > > limitied to 2GB or better to INT_MAX ?
> >
> > It's limited to 16GB on i386 (or maybe 16GB per swap device, I
> > forget).  You need a patch if you want to use this much, to avoid
> > deadlocks - but nothing limits it out of the box.
> 
> Of course if you actually use this much swap your machine will be incomparably 
> slow..

If you are actually trying to use working set > physical RAM then yes.
That's not the only case though.

I use 32GB of swap as backing for md disks for package builds, since
they are ephemeral and I don't care about the data persisting across
reboots.  It's a huge optimization to write to a md and never have the
backing pages written out to disk, and less of a huge optimization if
they are sometimes written out due to memory pressure, but still a net
win.

32GB is needed since the swap backing store tends to fill up over time
(unless you periodically destroy your md and recreate), since md
doesn't throw away pages when files are removed.  tmpfs will be the
perfect solution once it's mpsafe.

Kris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20060411/f4d0c75e/attachment.pgp


More information about the freebsd-stable mailing list