[lkml]   [2003]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: 2.2/2.4/2.6 VMs: do malloc() ever return NULL?
Rik van Riel wrote:
> On Tue, 25 Nov 2003, Ihar 'Philips' Filipau wrote:
>> 2.6: the same as 2.4 with oom killer (default conf). I have no test
>> system to check 2.6. w/o oom killer.
> # echo 2 > /proc/sys/vm/overcommit_memory
> Then try again.

What do you know what is not said in docs?
What '2' means?

I'll try as soon as I will have again access to 2.6 box.

this is what 2.6-test10 says:

> overcommit_memory
> This file contains one value. The following algorithm is used to
> decide if there's enough memory: if the value of
> overcommit_memory is positive, then there's always enough memory.
> This is a useful feature, since programs often malloc() huge amounts
> of memory 'just in case', while they only use a small part of it.
> Leaving this value at 0 will lead to the failure of such a huge
> malloc(), when in fact the system has enough memory for the program
> to run.
> On the other hand, enabling this feature can cause you to run out
> of memory and thrash the system to death, so large and/or important
> servers will want to set this value to 0.

Could this special case 'sysctl_overcommit_memory > 1' be added and
explained? (mmap.c:589)

I cannot tell what it does - but name 'security_vm_enough_memory()'
sounds promising ;-)

As I have said - I will check this later when I will get to those box.

Ihar 'Philips' Filipau / with best regards from Saarbruecken.
-- _ _ _
Because the kernel depends on it existing. "init" |_|*|_|
literally _is_ special from a kernel standpoint, |_|_|*|
because its' the "reaper of zombies" (and, may I add, |*|*|*|
that would be a great name for a rock band).
-- Linus Torvalds

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:58    [W:0.064 / U:75.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site