Today, an environment hung up. First, restart it. It was found that it didn’t get up. The following error was reported:
....
Cannot allocate memory
1. Check whether the thread is full first:
# check the maximum allowed processes
[root@test ~] sysctl kernel.pid_max
kernel.pid_max = 32768
#View the number of processes in progress on this server
[root@test ~] ps -eLf | wc -l
1597
2. Compare the above two values. If the two values are similar, increase the number of allowed processes:
Modify PID_ Max value (custom)
[root@test ~] echo 999999 > /proc/sys/kernel/pid_max
Settings take effect permanently
[root@test ~] echo "kernel.pid_max=999999" >> /etc/sysctl.conf
[root@test ~] sysctl -p
3. If it is not, check the Tomcat log:
then modify the memory allocation:
1. [root@test ~] vim/etc/sysctl.conf
vm.overcommit_memory=1
[root@test ~] sysctl -p
2.[root@test ~] echo 1 > /proc/sys/vm/overcommit_memory
[root@test ~] sysctl –p
3. [root@test ~] sysctl vm.overcommit_memory=1
Explanation:
memory allocation strategy in the kernel: overcommit_Memory
optional values: 0, 1, 2
0,: indicates that the kernel will check whether there is enough available memory for the process to use; If there is enough available memory, the memory application is allowed; Otherwise, the memory request fails and the error is returned to the application process
1: indicates that the kernel is allowed to allocate all physical memory regardless of the current memory state
2: indicates that the kernel allows to allocate more memory than the sum of all physical memory and swap space.
Read More:
- [Solved] Tomcat startup error: sub-container startup failed
- [Solved] nacos Startup Error: Unable to start embedded Tomcat
- [Solved] Nacos1.3.2 Startup Error: Unable to start embedded Tomcat
- [Solved] Tomcat Startup Error: Error deploying web application directory
- [Solved] Tomcat Startup Error: A child container failed during start
- [Solved] tomcat Startup Error: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
- [Solved] Docker Run Tomcat Error: Cannot find /usr/local/tomcat/bin/setclasspath.sh
- [Solved] Nacos Serve Local Startup Error: Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCre
- [Solved] Tomcat Startup Error: A child container failed during start、LifecycleException: Failed to start component
- [Solved] SpringBoot+Dubbo Startup Error: Fail to start server(url dubbo192.168.0.920880service
- [Solved] SpringBoot+Dubbo Startup Error: Fail to start server(url: dubbo://192.168.0.9:20880/service
- [Solved] Tomcat Error: org.apache.tomcat.util.digester.Digester.fatalError Parse fatal error at line [40] column [36]
- [Solved] Error running ‘tomcat:run‘: Cannot run program “tomcat:run“
- Consumer service instance error: HTTP get http://xxx/actuator/health: 503 output: {“status”: “out_of_service”
- Tomcat cross server upload error 403forbidden [How to Solve]
- kafka Environment Build and Startup Error: ERROR [KafkaServer id=1] Fatal error during KafkaServer startup. Prepare to shutdown
- [Solved] Tomcat runs JavaWeb servlet Error 404
- [Solved] Tomcat configurate HTTPS error: java.net.SocketException: Permission denied
- Tomcat Run Error: Can‘t find catalina.jar [How to Solve]
- [Solved] kafka startup Error: ERROR Fatal error during KafkaServer startup. Prepare to shutdown