Default VM overcommit sysctls in Ubuntu lead to unnecessary oom-killer invocation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Triaged
|
Medium
|
Unassigned |
Bug Description
On my system, running a couple of LXD containers and VMs (16 GB RAM, 16 GB swap) seems to cause the kernel oom-killer to be frequently triggered.
In order to try to resolve this, first I tried limiting the memory my containers were allowed to use, such as by using:
lxc config set <container> limits.memory 1024GB
... and restarting the containers for good measure. However, this didn't resolve the problem.
After looking deeper into what might trigger the oom-killer even though I seemed to have plenty of memory free, I found out that the kernel VM overcommit can be tuned with the `vm.overcommit_
The default for value of `vm.overcommit_
"""
calls of mmap(2) with MAP_NORESERVE are not checked, and the
default check is very weak, leading to the risk of getting a
process "OOM-killed".
"""
Which seems to describe exactly my problem. However, upon setting this value to 2, many of my open programs immediately aborted with out-of-memory errors. This is because the default value for `vm.overcommit_
I then found the following answer on Server Fault:
http://
The answers to this question seem to make a good case that the overcommit_ratio should be set to 100.
In summary, I think the following sysctl values should be the new defaults:
vm.
vm.
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in linux (Ubuntu): | |
importance: | Undecided → Medium |
tags: | added: kernel-da-key |
tags: | added: bot-stop-nagging |
Changed in linux (Ubuntu): | |
status: | Confirmed → Triaged |
This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:
apport-collect 1666683
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.