Log contains the error message “fork: Cannot allocate memory”.
There are too many processes. If a new process is created after the
pid_max value is reached, the error message “fork: Cannot allocate memory” will appear.
The default value of
sysctl -a | grep pid_max
32768, as shown below:
When the total number of processes has reached
pstree -p | wc -l
pid_max, a new process will cause the “fork: Cannot allocate memory” error.
You can use the
ps -efLcommand to locate the programs for which many processes are running.
kernel.pid_maxvalue in the
/etc/sysctl.confconfiguration file to
65535to increase the number of processes. The result should be as follows: