Out of Memory (OOM) Killer

Note: OOM killer exists because the Linux Kernel , by default, can commit to supplying more memory than it can actually provide.

when the size of the data to be copied exceeds the size of physical memory, OOM killer randomly begins killing processes in order to FREE MEMORY, often with bad/inaccurate results to any running Greenplum database queries. 

In Greenplum database, a single SQL statement creates several processes on the segment hosts to handle the query processing. Large queries will often trigger the OOM killer (ifit is enabled) causing the query to fail.

You can disable the OOM killer by changing the vm.overcommit_memory to 2.

Each of the following parameters is located under /proc/sys/vm/ in the proc file system.overcommit_memory

Defines the conditions that determine whether a large memory request is accepted or denied. There are three possible values for this parameter:

0 ) The default setting. The kernel performs heuristic memory overcommit handling by estimating the amount of memory available and failing requests that are blatantly invalid. Unfortunately, since memory is allocated using a heuristic rather than a precise algorithm, this setting can sometimes allow available memory on the system to be overloaded.

1 ) The kernel performs no memory overcommit handling. Under this setting, the potential for memory overload is increased, but so is performance for memory-intensive tasks.

2 ) The kernel denies requests for memory equal to or larger than the sum of total available swap and the percentage of physical RAM specified in overcommit_ratio. This setting is best if you want a lesser risk of memory overcommitment.

Note

This setting is only recommended for systems with swap areas larger than their physical memory.

overcommit_ratio

Specifies the percentage of physical RAM considered when overcommit_memory is set to 2. The default value is 50.

Read more about other capacity tuning parameters.

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Performance_Tuning_Guide/s-memory-captun.html