Processing of fork: cannot allocate memory caused by PID Max

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.