Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Apr 2011 17:29:47 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Pete French <petefrench@ingresso.co.uk>
Cc:        spawk@acm.poly.edu, freebsd-stable@FreeBSD.org, freebsd@jdc.parodius.com
Subject:   Re: Kernel memory leak in 8.2-PRERELEASE?
Message-ID:  <4D9B275B.3060000@FreeBSD.org>
In-Reply-To: <E1Q76rm-0001Cr-B2@dilbert.ticketswitch.com>
References:  <E1Q76rm-0001Cr-B2@dilbert.ticketswitch.com>

next in thread | previous in thread | raw e-mail | index | archive | help
on 05/04/2011 17:04 Pete French said the following:
>> Adding some swap would help a lot more.
> 
> So, I run a lot of systems without swap - basically my
> thinking at the time I set them up went like this.
> 
> "I have 4 gig of memory, and 4 gig of swap. Surely running 8 gig of
> memory and no swap will be just as good ?"
> 
> but, is that actually true ? Is real RAM as good as an equivalent amount
> of swap, or is there smething special about swap which means you shoud
> have some no matter how much RAM you have ?

I think that it depends.
I usually do use swap for the following reasons:
1. some anonymous memory ("malloced") may reasonably go to swap to free some RAM
for caching data;  that can have overall performance benefits depending in system
usage patterns;
2. VM is happy dealing out RAM for any uses until some low watermarks are reached,
then the system tries to free up some RAM.  Depending on the amount of memory (and
those thresholds) and "burstiness" of memory demand a system may potentially run
completely out of memory and would have to kill some processes.
Having swap provides some cushion.  Swap kind of smooths any bursts. (And it can
also slow things down as a side effect)
Of course, the system can run out of swap as well, but that would mean that you
really need more RAM.

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D9B275B.3060000>