Re: malloc under linux
- From: Eric Sosman <Eric.Sosman@xxxxxxx>
- Date: Wed, 03 Oct 2007 12:55:22 -0400
jacob navia wrote On 10/03/07 12:39,:
Hi
I was working under linux today when I discovered this:
man malloc
<quote>
[snip pages]
BUGS
By default, Linux follows an optimistic memory allocation strategy.
This means that when malloc() returns non-NULL there is no guarantee
that the memory really is available. This is a really bad bug.
In case it turns out that the system is out of memory, one or more
processes will be killed by the infamous OOM killer. In case Linux is
employed under circumstances where it would be less desirable to
suddenly lose some randomly picked processes, and moreover the kernel
version is sufficiently recent, one can switch off this
overcommitting behavior using a command like
# echo 2 > /proc/sys/vm/overcommit_memory
<end quote>
I just can't believe my eyes.
Old news. In fact, it's Question 7.14 in the FAQ.
See also <http://lwn.net/Articles/104179/>.
--
Eric.Sosman@xxxxxxx
.
- Follow-Ups:
- Re: malloc under linux
- From: jacob navia
- Re: malloc under linux
- References:
- malloc under linux
- From: jacob navia
- malloc under linux
- Prev by Date: Re: program
- Next by Date: Re: Quickly exiting from nested calls
- Previous by thread: malloc under linux
- Next by thread: Re: malloc under linux
- Index(es):
Relevant Pages
|
|