Subject: Re: Replacement for grep(1) (part 2)
To: Jon Ribbens <jon@oaktree.co.uk>
From: Daniel C. Sobral <dcs@newsguy.com>
List: tech-userlevel
Date: 07/12/1999 16:56:23
Jon Ribbens wrote:
> 
> Yuck. That's a complete abomination. What's the point of it? It's turning
> an out-of-memory situation from an easily-detected recoverable temporary
> resource shortage which can be worked-around or waited out, into an
> unrecoverable fatal error. Do a significant number of programs really
> request memory which they then proceed not to use?

That's *not* abomination. How about pre-allocating over 100 Mb for X
Free, for instance? Basically, if you don't have enough memory, you
just don't have enough memory. What FreeBSD does *reduces* the need
for memory. If FreeBSD *did not* do it, then you'd need much more
memory.

> > If the system runs out of memory, the biggest process is killed. It
> > might or might not be the one demanding additional memory.
> 
> No, if the *process* hits its *administrative* resource limits.
> i.e. setrlimit(2).

Ah, that's another matter entirely. Then, malloc() returns an error
indeed.

--
Daniel C. Sobral			(8-DCS)
dcs@newsguy.com
dcs@freebsd.org

	I'm one of those bad things that happen to good people.