FreeBSD Install config

AMAKAWA Shuhei sa264 at
Sun Dec 23 08:30:02 GMT 2001

At Fri, 21 Dec 2001 11:40:36 -0000,
Paul Richards wrote:
> (I've used the term swapping a lot here, but strictly speaking what we're
> talking about is paging. If your system is really swapping i.e. whole
> processes are getting flushed out to swap, then you really need to put a
> lot more physical memory in your box because the VM system is taking
> desperate measures to try and cope with the memory load)
> With FreeBSD's VM architecture the total memory available to processes is

Well, although no swap is allocated as in SunOS when a process is
started, memory allocation and swap allocation are a bit different.

> If you exceed the total memory available then your processes start to die,
> so it's a simple question of how you make up the total memory in your
> system.
> You could have a 512M DIMM, or you could have 256M DIMM and 256M of swap,
> in both cases the amount of memory available to processes is 512M, but in
> the latter case pages have to be shuffled between the "fast" and "slow"
> parts of the total memory available. It's a bit like having another layer
> of cache, those pages that are currently being "hit" are moved into the
> faster memory, just like having them in the cache.
> So, the rule for determining how much swap you need should be based on your
> calculations as to what the maximum memory usage of the system will ever
> be. If you do those calculations when you're building the box then you
> should just put enough memory in to match that figure, since memory is very
> cheap these days.
> I'm not advocating having no swap since with the sizes of disks these days
> you might as well throw 256 or 512M at a swap partition, and then when you
> unexpectedly load the box more than you originally intended you have that
> as a fallback, rather than have your processes die, but figures like 2 x
> real memory are way out of date, and with the sizes of DIMMs these days
> you'll just waste a lot of disk space.

I take your point totally and didn't question that.  The point
which I asked earlier was whether the swap size affects the swap
pager performance.  It's nicer to have an efficient swap than an
inefficient swap, if you need swap at all.  Sometimes adding memory
is not an option (e.g. laptops).  But disks are even cheaper and
more available.

If I had more than one disk on a machine, then I would make a swap
partition on each disk, for performance.  But this is what I would
do and I'm not trying to lobby for that.  Swap is just a safety net
if you have a lot of memory.  I just want a better safety net.

> FreeBSD doesn't swap out idle pages unless it runs out of physical memory
> so if your system has abundant memory then you'll *never* see any swapping.

On my machine with abundant memory (1GB), up to a few tens of pages
always get swapped out during the night, presumably due to a daily
script.  Physical memory is not running out in a normal sense there.
The same thing happens on all other machines (with less memory)
which I have access to.  Anyway, this is absolutely fine.

I don't know the precise definition of "running out of physical
memory."  You could certainly define it as the outset of swapping.
1GB on an otherwise idle machine might not be abundant.


More information about the Ukfreebsd mailing list