bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with malloc on very large blocks of memory


From: Paul Jarc
Subject: Re: Problem with malloc on very large blocks of memory
Date: Mon, 24 Mar 2003 13:21:50 -0500
User-agent: Gnus/5.090017 (Oort Gnus v0.17) Emacs/21.2 (gnu/linux)

"Petr Vandrovec" <address@hidden> wrote:
> Then set /proc/sys/vm/overcommit_memory to "2" to disable overcommit.

0, not 2.  Documentation/sysctl/vm.txt:
==============================================================

overcommit_memory:

This value contains a flag that enables memory overcommitment.
When this flag is 0, the kernel checks before each malloc()
to see if there's enough memory left. If the flag is nonzero,
the system pretends there's always enough memory.

This feature can be very useful because there are a lot of
programs that malloc() huge amounts of memory "just-in-case"
and don't use much of it.

Look at: mm/mmap.c::vm_enough_memory() for more information.

==============================================================


paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]