Subject: Re: Swap sizes vs. physical memory.
To: Claude Marinier <claude.marinier@dreo.dnd.ca>
From: David Brownlee <abs@anim.dreamworks.com>
List: netbsd-help
Date: 09/09/1999 09:25:52
	Could someone add this to the FAQ? - thanks :)

On Thu, 9 Sep 1999, Claude Marinier wrote:

> In summary,
> 
> 1) you can run with no swap space at all
> 
> 2) if you want a full core dump after a crash, swap space must
>    be as large as physical memory (or a bit larger?)
> 
	I believe the first swap partition must be slightly larger than
	physical memory (the dump code does not know how to split across
	multiple partitions).

> 3) the size of swap is determined by your work load: active
>    processes, dormant processes, transients, ...
> 
> 4) four times physical memory is a relic of the past, with
>    today's typically large amount of physical memory, the
>    recommendation should be somewhere between 1.0 and 2.0 times
>    physical memory (or should that be 1.x and 2.0 ?)
> 
	That seems very reasonable :)

> NetBSD appears to allocate swap space using the 'deferred' or 'lazy' mode.
> How does NetBSD actually allocate swap space? Could a process be killed
> because of insufficient swap space?
> 
	That is correct - NetBSD does not preallocate swap space based on
	programs' current data usage. In a preallocation model:
		virtual memory = min(physical memory,swap).

	In the NetBSD model:
		virtual memory = physical memory + swap.

	This means you have more virtual memory available, but is it
	possible to malloc memory correctly and then fail when you come
	to use it.

	In either model a process can be killed when you run out of VM.

> I do not expect a long dissertation in response; rather a short
> explanation (if this is possible) or a pointer to a document on the net
> somewhere. I note that no one made reference to such a document in this
> thread. Is there such a thing?

	We should probably ensure it gets added :)

		David/absolute

                  -=-  Trust is a non-renewable resource  -=-