Subject: Re: building -current userland
To: Tim Kelly <hockey@dialectronics.com>
From: Bruce O'Neel <edoneel@sdf.lonestar.org>
List: port-macppc
Date: 05/03/2005 10:56:17
Hi,

On Mon, May 02, 2005 at 02:47:42PM -0400, Tim Kelly wrote:
> >    [1]   Killed                  (/usr/ ...
> >    *** Error code 137
> 
> At worst I would think the script could grep dmesg, and for processes that
> require large amounts of physical memory there ought to be a sysctl to
> check.  If the limitation is physical+swap, then the kernel should be able
> to inform a process of how much memory it can actually use.  That's been
> present in MacOS since System 7, so surely a BSD OS can do the same.  Of
> course, since we had a much more constrained memory model, we took more
> pains to ensure we had a good handle on our memory usage.  When memory
> seems to be free (as in 4G), this practice seems to go by the wayside.
> 

NetBSD, like many other systems, over commits memory.  Ie, if you have say 
200 meg of swap on a system, two different processes can ask for 150 meg.
This, of course, won't work.  But the malloc calls will succeed and everything 
will be all happy until both processes together start using more than 200meg.
Then you're in trouble.  The solution is to make sure that you have
enough swap space to hold the sum of the size of all the programs that
one wants to run.

cheers

bruce


-- 
edoneel@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org