Linux OOM killer (Out of memory) and NFS server optimization

OOM is short form for Out of memory. As name suggest it kills process randomly when the size of the data to be copied exceeds the size of physical memory i.e. when out of memory situation occurs OOM kills the lower priority process and frees the memory.

It is the job of the linux ‘oom killer’ to sacrifice one or more processes in order to free up memory for the system when all else fails.

Recently I fixed NFS related problem by setting vm.lower_zone_protection to 150 via sysctl facility. A reasonable value for lower_zone_protection is 150. But what is 150? It is 150 MB (approximately).

The lower_zone_protection tunable determines how aggressive the kernel is
in defending these lower zones. In simple words – I am preventing NFS eating up all memory and keeping my system stable. Remember 150MB will be reserved and not allocated to any one including applications, users, and cache.

Open your /etc/sysctl.conf and add following line (thanks to Alexander N. Spitzer for solution/hint):
# vi /etc/sysctl.conf
Append followin line:
vm.lower_zone_protection = 150
Save the change and reboot system. Mount NFS share and it will now able to create large file.

On the other hand, you can type the following command at shell prompt:
# echo 150 > /proc/sys/vm/lower_zone_protection

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 5 comments so far... add one

CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
5 comments… add one
  • Mikhael Oct 14, 2016 @ 8:21

    Me too, on Debian 8.
    # cat /proc/sys/vm/lower_zone_protection
    cat: /proc/sys/vm/lower_zone_protection: No such file or directory

    Running kernel: 4.4.10-1-pve

  • Moses Sep 16, 2012 @ 10:08

    I’m not find variable on centos 6.X

    cat /proc/sys/vm/lower_zone_protection

    cat: /proc/sys/vm/lower_zone_protection: No such file or directory


  • Vasudeva Oct 16, 2009 @ 20:33

    Specified lower_zone protection works for all applications? Like I have n number of applications running on host A, after adding one more application (n +1), host was stable for a week without any problem. But I got OOM killer issue after a week and started killing most of the processes one by one. To fix the issue I disabled n + 1 application and rebooted the host. Can I configure lower_zone protection to solve above problem?

  • 🐧 nixCraft Aug 21, 2006 @ 11:19


    OOM kills the lower priority process and frees the memory, if there are 10 process with lower priority process, OOM will select any random process from pool of 10 process. That is why I had used the word ‘random‘.

    However, the algorithm written by Linux kernel developer is quite smart to detect which process to kill. Unfortunately some time *smart algorithm* fails to work (for example my NFS Server) and it started to kill important process such as sendmail.

    That is why I had to control OOM via sysctl. Now system is stable. Correct me if I am wrong here.

    Appreciate your post.

  • Sandro Tosi Aug 21, 2006 @ 7:03

    It doesn’t kill randomly! It select the “best” process to kill, as stated in the description page you linked in the page

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @