Showing posts with label disable oom. Show all posts
Showing posts with label disable oom. Show all posts

Thursday, December 2, 2010

Steps to disable OOM Killer on Linux

OOM kills any process which has been waiting for a long time. But some times, we need to avoid this and make sure these long waiting processes are allowed to complete even if it takes much more time.
To disable OOM, follow the below steps.

Check status of oom-killer:

# cat /proc/sys/vm/oom-kill

Turn oom-killer off/on:
# echo "0" > /proc/sys/vm/oom-kill
# echo "1" > /proc/sys/vm/oom-kill

To make this change take effect at boot time, add the following
to /etc/sysctl.conf:
vm.oom-kill = 0

For processes that would have been killed, but weren't because the oom-
killer is disabled, you'll see the following message
in /var/log/messages:
"Would have oom-killed but /proc/sys/vm/oom-kill is disabled"