Linux Error: Page Allocation Failure and Solution

Q. How do I get rid of an error message that read as – “Page allocation failure“?

A. Memory management is done by Linux kernel. Virtual memory systems separate the memory addresses used by a process from actual physical addresses, allowing separation of processes and increasing the effectively available amount of RAM using disk swapping. The quality of the virtual memory manager can have a big impact on overall system performance. This error related to memory fragmentation i.e. a new job / process cannot be loaded into memory due to fragmentation issue. To get rid of this problem try all of the following:

  1. Upgrade kernel to latest version
  2. Set VM kernel variables using sysctl or /etc/sysctl.conf file. /proc/sys/vm used for the virtual memory subsystem. You need to setup following two variables:

  • vm.lower_zone_protection=N : If running the 32-bit hugemem kernel isn’t an option either, you can try setting /proc/sys/vm/lower_zone_protection to a value of 250 or more.
    This will cause the kernel to try to be more aggressive in defending the low zone from allocating memory that could potentially be allocated in the high memory zone. As far as I know, this option isn’t available until the 2.6.x kernel.
  • vm.vfs_cache_pressure=N : Controls the tendency of the kernel to reclaim the memory which is used for caching of directory and inode objects. At the default value of vfs_cache_pressure=100 the kernel will attempt to reclaim dentries and inodes at a “fair” rate with respect to pagecache and swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer to retain dentry and inode caches. Increasing vfs_cache_pressure beyond 100
    causes the kernel to prefer to reclaim dentries and inodes.
  • For 32 bit systems with 4GiB or more RAM consider using the hugemem kernel, which has almost 4GB lowmem area.
  • Sample /etc/sysctl.conf for Kernel 2.6.x


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

    🐧 1 comment so far... add one

    CategoryList of Unix and Linux commands
    Disk space analyzersdf ncdu pydf
    File Managementcat cp mkdir tree
    FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
    Network UtilitiesNetHogs dig 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
    1 comment… add one
    • Peter Mar 3, 2013 @ 22:19

      You need to enclose the value for vm.lowmem_reserve_ratio in /etc/sysctl.conf with single quotes, like this:
      vm.lowmem_reserve_ratio = ‘256 256 9’

      You also need the quotes if you change it on-the-fly with
      # echo ‘256 256 9’ > /proc/sys/vm/lowmem_reserve_ratio

    Leave a Reply

    Your email address will not be published.

    Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum