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"
/proc/sys/vm/oom-kill does not exist.
ReplyDeleteHi,
ReplyDeletewhen I try the command
echo "0" > /proc/sys/vm/oom-kill
i get this error:
cannot create /proc/sys/vm/oom-kill: Directory nonesistent
Is there another directory when I could find the oom-killer?
Thank you.
This is for RHEL. Can you please let me know your OS details.
ReplyDeleteYou can always add the following to disable oom-killer at startup.
File:- /etc/sysctl.conf
vm.oom-kill = 0
On OpenSUSE, the file is /proc/sys/vm/oom_kill_allocating_task to view the status and just 'oom_kill_allocating_task' for the sysctl key, which would be set to '0'. Hope this helps (I know it's 3 years later!)
ReplyDelete