Gentoo Archives: gentoo-user

From: Godzil <godzil@××××××.net>
To: "gentoo-user@l.g.o" <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] OOM memory issues
Date: Thu, 18 Sep 2014 16:56:28
Message-Id: 714017E8-9E3B-48AD-B090-C67EC0ECF13E@godzil.net
In Reply to: Re: [gentoo-user] OOM memory issues by Kerin Millar
1 You could also disable the overcommitment so that an app that ask for too much memory will be denied (you know the possible NULL pointer malloc could return. With overcommit, it will never return NULL whatever the memory status is. Without this, all requested memory is really allocated, and malloc will fail if it is unable to reserve the asked memory size.
2
3
4
5 > Le 18 sept. 2014 ¨¤ 17:27, Kerin Millar <kerframil@×××××××××××.uk> a ¨¦crit :
6 >
7 >
8 >> On 18/09/2014 16:48, James wrote:
9 >> Hello,
10 >>
11 >> Out Of Memory seems to invoke mysterious processes that kill
12 >> such offending processes. OOM seems to be a common problem
13 >> that pops up over and over again within the clustering communities.
14 >>
15 >>
16 >> I would greatly appreciate (gentoo) illuminations on the OOM issues;
17 >> both historically and for folks using/testing systemd. Not a flame_a_thon,
18 >> just some technical information, as I need to understand these
19 >> issues more deeply, how to find, measure and configure around OOM issues,
20 >> in my quest for gentoo clustering.
21 >
22 > The need for the OOM killer stems from the fact that memory can be overcommitted. These articles may prove informative:
23 >
24 > http://lwn.net/Articles/317814/
25 > http://www.oracle.com/technetwork/articles/servers-storage-dev/oom-killer-1911807.html
26 >
27 > In my case, the most likely trigger - as rare as it is - would be a runaway process that consumes more than its fair share of RAM. Therefore, I make a point of adjusting the score of production-critical applications to ensure that they are less likely to be culled.
28 >
29 > If your cases are not pathological, you could increase the amount of memory, be it by additional RAM or additional swap [1]. Alternatively, if you are able to precisely control the way in which memory is allocated and can guarantee that it will not be exhausted, you may elect to disable overcommit, though I would not recommend it.
30 >
31 > With NUMA, things may be more complicated because there is the potential for a particular memory node to be exhausted, unless memory interleaving is employed. Indeed, I make a point of using interleaving for MySQL, having gotten the idea from the Twitter fork.
32 >
33 > Finally, make sure you are using at least Linux 3.12, because some improvements have been made there [2].
34 >
35 > --Kerin
36 >
37 > [1] At a pinch, additional swap may be allocated as a file
38 > [2] https://lwn.net/Articles/562211/#oom
39 >