Subject: Re: Minimum swap size?
To: S. N. Cho <sucho2@vt.edu>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-help
Date: 01/17/2003 10:55:08
On Fri, 17 Jan 2003, S. N. Cho wrote:

> I have recently upgraded the system memory to ~384M.  But, does this mean that
> I need to make the swap size on disk ~768M?

No, not at all. If you add real memory, you need less swap, not more.

> I only have 4.8G of hard disk
> space and with ~768M of swap space, that only leaves me roughly 1.3G of free
> space after everything is installed.  Which makes compiling the NetBSD from
> sources virtually out of question.  I am asking this because last time I had
> only 128M of RAM with 256M for swap, and compilation of KDE2 failed
> indicating lack of swap space!  Only after making my swap space 4x the
> physical RAM, in this case 512M swap for 128M of RAM, was I successful in
> compiling KDE2.

So on the successful run, you had 640mb of virtual memory available.
To duplicate that with 384mb of real RAM, you need only 256mb of swap.
The multiples calculation is not relevant to this problem at all. The
only relevant multiple is "1" (one) -- to take a core dump, you need
to have a swap (dump) partition at least equal to your real RAM, and
room in /var/crash to take it. That can be useful for debugging a
crash, but you could live without it. In fact, if you have enough
memory, you don't need any swap at all.

It's actually unlikely that 384mb wasn't enough to compile KDE. You
usually have to increase your per process limits beyond the defaults,
but not that high...

> I was wondering with 384M of free RAM, I would still need
> roughly 4x swap, i.e., 1.5G for swap for 384M of RAM!, to compile KDE3.
> Last time I tried compiling KDE3 with 384M of RAM and 512M of swap, KDE3
> failed during the compilation.  I assumed this was the same lack of swap
> space issue (even with that extra 256M of free RAM!).  I  really have no idea
> how swap space is handled under NetBSD and why KDE3 would require so much
> swap to compile even when you have good chunk of RAM!   Thank you.

gcc 2.95.3 uses a lot more memory than the old versions did, but it
also compiles better object code. Yet, 384mb is a lot. How do you know
you're even running out of RAM? What's the exact error?

Frederick