Subject: Re: building -current userland
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Tim Kelly <hockey@dialectronics.com>
List: port-macppc
Date: 05/02/2005 14:47:42
At 3:33 AM +0900 5/3/05, Izumi Tsutsui wrote:
>Userland processes can't detect physical memory shortage directly
>(it's running on VM system), but if it happens the process will be
>killed by kernel with the kernel message noted above and the buildlog
>should say like:
>
>    [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.

>Isn't it enough?

I'd prefer to be informed before I send a job off for something that takes
twenty plus hours to fail.  Others may be more tolerant of this, so I may
be in the very small minority.

tim