Subject: Re: Swap sizes vs. physical memory.
To: Richard Rauch <rkr@rkr.kcnet.com>
From: Patrick Welche <prlw1@newn.cam.ac.uk>
List: netbsd-help
Date: 09/05/1999 15:44:36
Richard Rauch wrote:
>
> > >My understanding is that total virtual memory is essentially equal to
> > >physical RAM + swap-size. Correct? And, although a swap-size of approx.
> > >4x physical memory is recommended, there's no particular condition on the
> > >size of the swap paritition. Correct?
> > >
> >
> > I don't know if UVM has changed this requirement but, yes, there was a
> > lower limit on the amount of swap you had (I suspect UVM has lifted
> > this but...). In older BSD systems you needed to have at least the
> > same amount of swap as you had physical RAM because each memory page
> > needed to be backed by a swap page. The old rule of thumb was at
> > least twice the physical RAM size was a good swap size to give you
> > some pages for data.
>
> Hm. Ouch. That's what I was afraid of. I really didn't want to
> repartition my drive just because I'm adding memory, though. (I thought
> that, even pre-UVM, under 1.3, there were options about explicitly
> disabling the swap---e.g., for diskless workstations.)
>
> My hope was that that meant that I could have arbitrarily small swap
> space. (In this case, ``small'' would be about 4/5ths of my actual
> memory.)
I have been running a computer with less swap than memory with no ill
effect, so "go for it!". As Brett mentioned, I did have to increase
swap once on another computer to fiddle with core dumps, but they aren't
to be expected..
NetBSD-1.4/arm32
real mem = 41943040
avail mem = 36204544
% swapctl -lk
Device 1K-blocks Used Avail Capacity Priority
/dev/wd1b 30240 4 30236 0% 0
ie 40Mb RAM, 30Mb swap
Cheers,
Patrick