Websites down: Error: Fork failed - Cannot allocate memory

Created:

2016-11-16 13:24:34 UTC

Modified:

2017-04-24 11:11:37 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Websites down: Error: Fork failed - Cannot allocate memory

Applicable to:

  • Plesk for Linux

Symptoms

  • Many actions on a server are blocked with the following error:

    Cannot allocate memory
  • One of the following is applicable:

  • Server is running out of free memory:

        [root@server ~]# free -m
    total used free shared buffers cached
    Mem: 994 897 96 106 21 351
    -/+ buffers/cache: 524 469
    Swap: 0 0 0
  • Container limits have been reached:

        [root@server ~]# awk '$NF > 0' /proc/user_beancounters
    Version: 2.5
    uid resource held maxheld barrier limit failcnt
    privvmpages 1954900 5089134 3500000 4000000 93324

    Reached limits are identified by the non-zero value of the `failcnt` column.

    Other container resources may also be exceeded. For example, `kmemsize` and `numproc`:

    # grep -E "kmemsize|numproc" /proc/user_beancounters
    72030666: kmemsize 21389702 21893120 20971520 23068672 189
    numproc 86 87 96 96 9
  • Sometimes some pages in Plesk return the following error:

    502 bad gateway nginx
  • The following error is shown when attempting to open Plesk web interface or update a license key:

    Error: The license key is invalid. In order to use Plesk, you need to obtain and install a new valid license key.
    The license key is intended only for use with Plesk operating inside the following virtual environments: Virtuozzo containers, VMWare, Microsoft Hyper-V, Xen, KVM, Virtuozzo Server, LXC, Docker.
  • The following errors can be found in /usr/local/psa/admin/logs/panel.log file:

    ERR [1] Exception: PHP Warning: proc_open(): fork failed - Cannot allocate memory
    ERR [1] PleskUtilException: /usr/local/psa/admin/bin/filwrpr '93' failed with message: Unable to execute the utility.
  • And following errors can be found in /var/log/sw-cp-server/error_log :

    (mod_fastcgi.c.2746) FastCGI-stderr: PHP Warning: proc_open() [<a href='function.proc-open'>function.proc-open</a>]: fork failed - Cannot allocate memory; File: /opt/psa/admin/plib/common_func.php3, Line: 1318
    MemoryError: out of memory
  • The following error can appear during backup creation:

    /opt/psa/admin/sbin/pmm-ras --get-dump-info --dump-file-specification=backup_info_1606282257.xml --with-feedback --session-path=/opt/psa/PMM/sessions/2016-06-28-225702.380 --verbose
    error : Memory allocation failed : buffer error: text too long
    error : Memory allocation failed : growing buffer
    I/O error : write error
    Error: boost::too_many_args: format-string referred to less arguments than were passed
  • There also may be other errors:

    [root@server ~]# /usr/local/psa/bootstrapper/pp11.5.30-bootstrapper/bootstrapper.sh repair
    date: write error: Cannot allocate memory /usr/local/psa/bootstrapper/pp11.5.30-bootstrapper/bootstrapper.sh: fork: Cannot allocate memory

    Or

    [root@server ~]# /usr/local/psa/admin/bin/nginxmng -s 
    PHP Warning: proc_open(): fork failed - Cannot allocate memory; File: /usr/local/psa/admin/plib/common_func.php3, Line: 560

    Or

    [root@server ~]# /usr/local/psa/admin/bin/send-error-report: error while loading shared libraries: /lib64/libpthread.so.0: cannot apply additional memory protection after relocation: Cannot allocate memory

    Or

    [root@server ~]# rm file
    -bash: fork: Cannot allocate memory

Cause

  • Server is running out of RAM.
  • Some limits are exceeded on a container or on a hardware node.

Resolution

  1. Increase amount of RAM or SWAP on the server.
  2. In order to increase resources for a container or for a hardware node, please contact your service provider.
Have more questions? Submit a request
Please sign in to leave a comment.