Log contains the error message “fork: Cannot allocate memory”.
This issue may be caused by excessive threads. If a new thread is created after the
pid_max value is reached, the error message “fork: Cannot allocate memory” appears.
sysctl -a | grep pid_max
The default value of
32768, as shown below:
3. Run the following command to view the total number of threads.
pstree -p | wc -l
When the total number of threads has reached
pid_max, a new thread will cause the “fork: Cannot allocate memory” error.
You can use the
ps -efLcommand to locate the programs for which many threads are running.
kernel.pid_maxvalue in the
/etc/sysctl.confconfiguration file to
65535to increase the number of threads. The result should be as follows: