[CentOS] Setting overcommit_memory=2 kills system

Fri May 18 16:39:16 UTC 2012
Les Mikesell <lesmikesell at gmail.com>

On Fri, May 18, 2012 at 11:24 AM, Michael Coffman
<michael.coffman at avagotech.com> wrote:
>
>> If you are already overcommitted, what do you expect to happen when
>> you say not to allow that?   The kernel doesn't have a really good way
>> to handle that situation (or any other OOM condition for that
>> matter...).
>>
>>
> OK.  So I was confused because free shows I have plenty of memory and I am
> only now noticing that Committed_AS shows a very large value.   This is
> largely an idle system:
>
>             total       used       free     shared    buffers     cached
> Mem:       2052176     951648    1100528          0     147580     626096
> -/+ buffers/cache:     177972    1874204
> Swap:      2052088          0    2052088
>
> So my real question should have been why would the Committed_AS value be so
> large?
> Committed_AS:   137197248820 kB
>
> On the exact same hardware with fresh build of centos5u4 and overcommit
> turned on:
> Committed_AS:   125716 kB

I think that means an application has malloc()'d but not actually used
a huge amount of memory.   It used to be a common practice to test the
amount of memory available by requesting more until the request
failed, so it could be meaningless.  If overcommit is turned off the
app gets an error when it expects and backs off.  The Committed_AS is
an estimate of how much RAM/swap you would be likely to need if the
requested storage is actually used.

-- 
    Les Mikesell
      lesmikesell at gmail.com