SSH远程登录一台服务器时,报如下错误:-bash: fork: Cannot allocate memory
出现这种情况,主要是因为进程跑满了,memory被消耗光了,无法为其他的操作。
问题原因:[root@localhost ~]# ssh 10.0.242.13 [email protected]'s password: Last login: Fri Dec 9 15:14:51 2022 from 100.100.105.29 -bash: fork: Cannot allocate memory -bash-4.2# df -Th -bash: fork: Cannot allocate memory ......
查看系统进程数
查看最大进程数 # sysctl kernel.pid_max 查看进程数 # ps -eLf | wc -l问题解决
修改最大进程数后系统恢复 # echo 1000000 > /proc/sys/kernel/pid_max 永久生效 # echo "kernel.pid_max=1000000 " >> /etc/sysctl.conf # sysctl -p
标签:fork,kernel,Cannot,报错,allocate,memory,bash From: https://www.cnblogs.com/saneri/p/16969253.html