Tuesday 12 July 2016

-bash: fork: Cannot allocate memory in RHEL 6/CentOS 6

-bash: fork: Cannot allocate memory in Red Hat Enterprise Linux 6 (or) CentOS 6

Solution:-
This problem is caused because of Process Identifiers Limit, Increasing the value will help on large Linux system or clusters to ease process identification and process management, So that we can avoid this kind error “-bash: fork: Cannot allocate memory”

If you want to check current value execute this command

# cat /proc/sys/kernel/pid_max
32768

(OR)

# sysctl kernel.pid_max
kernel.pid_max = 32768

So I am going to increase this value to 65534.

# echo kernel.pid_max = 65534 >> /etc/sysctl.conf

To configure kernel parameters at runtime use sysctl command

# sysctl –p

{Note: p option is used to load sysctl setting from the file      /etc/sysctl.conf }



1 comment:

  1. HI ,

    I also faced similar issue, but got fixed after restarting the entire application?(after that not observed this). Can u tell me what is cause of this error?

    ReplyDelete