Subject: Re: Replacement for grep(1) (part 2)
To: Nate Williams <nate@mt.sri.com>
From: Matthew Dillon <dillon@apollo.backplane.com>
List: tech-userlevel
Date: 07/14/1999 16:16:20
:
:Returning NULL isn't an error, it's an indication that there is no more
:memory.  Don't think if it as an error, think of it as a hint. 

    It's only a hint if it is returned due to the process resource limit
    being hit.  If it is returned due to the system running out of swap,
    it would be an error.

    Look at it this way:  Processes run in their own VM address space and
    should theoretically be unaffected by other processes.  If your resource
    limits allow a process, say, 32MB of ram, the process should be confident
    in its ability to utilize that much if it needs to without running out of
    memory.  This is what FreeBSD and most UNIX's give to processes.

    But if you change the rules so that process A can run the system out of
    swap (or, in the case of a non-overcommit model, out of reservable
    space), then process B can get allocation errors without even coming close
    to their allocation limit.

    This creates a dependancy between two completely independant processes
    possibly owned two totally unrelated users.  This is not acceptable,
    and is precisely why this sort of behavior does not occur.

							-Matt