ts-7000
[Top] [All Lists]

Re: [ts-7000] Out of memory error?

To:
Subject: Re: [ts-7000] Out of memory error?
From: Paulo Marques <>
Date: Thu, 07 Dec 2006 13:25:09 +0000
Christopher Friedt wrote:
> Likely, yes.
> 
> The funny thing about linux (if you check man malloc) is that there is
> no gaurantee that malloc'd memory is actually there. To quote the author
> of the man page "this is a really bad bug".

Saying that this is a really bad bug just shows that the guy that wrote 
the man page doesn't have a clue about the way the Linux VM subsystem 
works and the magic that it does to keep everything working.

Just check this old thread (bare in mind that this is from March, 1995):

http://groups.google.com/group/comp.os.linux.development.apps/browse_frm/thread/eaca185ceada7efc/77537d4a28245300?tvc=1&q=#77537d4a28245300

and in particular this post from Linus:

http://groups.google.com/group/comp.os.linux.development.apps/tree/browse_frm/thread/eaca185ceada7efc/f65e73097867c865?rnum=61&_done=%2Fgroup%2Fcomp.os.linux.development.apps%2Fbrowse_frm%2Fthread%2Feaca185ceada7efc%2F77537d4a28245300%3Ftvc%3D1%26q%3D%26#doc_580f0d3ce32afb27

> You can switch off the 'overcommit' bug by doing
> 
> # echo 2 > /proc/sys/vm/overcommit_memory
> 
> I would imagine that makes malloc return a gauranteed section of memory.
>
> Does this relate somehow as well to linux killing random processes when
> it runs low on memory?

It sure does ;)

It is a bit rude to call it random, though. The OOM killer still tries 
to select "good" processes to kill :)

Anyway, when this happens you don't actually have enough memory for your 
"resident set", not to mention that most of the executable code is 
already pushed out (because it can be recovered from persistent 
storage). If you set the overcommit setting to "2", malloc will start 
returning NULL much, much sooner than that.

When you get to this point, it is a clear sign that your hardware can't 
handle the requirements of your problem. There is nothing the kernel can 
do about it.

As a disclaimer, there have been a few bugs in the OOM killer in the 
past that made it trigger with swap space still available and other 
similar scenarios. These were *bugs* and they have nothing to do with 
the way the VM *should* work.

I'm sorry about the long post, but this overcommit question comes up 
much too often, and people are not aware of its complexity most of the time.

See ya,

-- 
Paulo Marques - www.grupopie.com

"The face of a child can say it all, especially the
mouth part of the face."


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU