Re: Avoiding OOM on overcommit...?

From: Sandy Harris (sandy@storm.ca)
Date: Fri Mar 24 2000 - 11:24:41 EST


James Sutherland wrote:

> >BUT "when I use up the resources given to me" - If the resources
> >weren't available, why did the system give them to me?
>
> It didn't.

If he did a [mc]alloc to ALLOCate the the memory and got a non-null
return, it certainly said it did.
 
> >> >Who gets killed - your process or mine?
> >> Yours, because there aren't enough resources to run it.
> >
> >The system told me there were enough resources.
>
> You asked it if there was 128Mb of VM free; there was.

If I used [mc]alloc(), I wasn't asking about free resources. I was
asking for ALLOCation of memory.

> Half an hour later, you try to use 128Mb of VM and fail.

If a process can segfault trying to use memory it has succeeded in
allocating, then the system has made a ghastly error.
 
> There is a rather simpler explanation than the nasty kernel having
> lied to you...

The explanation is not the issue. The issue is having programs that
act correctly (check malloc() returns, don't follow null pointers,
etc.) fail in ways that are quite difficult for their programmers
to prevent.

For example, this implies one should not run a production database on
a multi-user Linux machine since it could crash in non-recoverable
ways.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 21:00:13 EST