An overseas server started to appear early in the morning and cannot log on to the game. In the morning, the operations staff informed the server to check the information.
The prompt "Bash: fork: cannot allocate memory" appears when you run a command.
After entering the TOP command several times, we can see that there is still memory remaining.
If you cannot view other commands, you must restart the server on the console.
Check the question about this prompt.
Check the related processes and threads after the restart and find that the JDK thread has been increasing. It should have been increasing only, resulting in exceeding the system's default kernel. pid_max = 32678.
You only need to find R & D personnel to optimize the code.
The system can only increase kernel. pid_max first.
###
View the maximum number of processes sysctl kernel. pid_max
PS-elf | WC-l view the number of processes
Check that the number of processes is full.
Restore the system after modifying the maximum number of processes
Echo 1000000>/proc/sys/kernel/pid_max
Valid permanently
Echo "kernel. pid_max = 1000000">/etc/sysctl. conf
Sysctl-P
Reference: Analysis and Solution of fork: cannot allocate memory caused by PID Max
51917757
Refer to-Bash: fork: cannot allocate memory for troubleshooting.
66473884
Processing of fork: cannot allocate memory caused by PID Max