有时我收到错误-bash: fork: Cannot allocate memory
,但是当我运行free -m
时,它显示我有足够的内存:
total used free shared buffers cached
Mem: 128942 107886 21055 0 1037 17665
-/+ buffers/cache: 89183 39758
Swap: 0 0 0
也许它有......与ulimit
有关,我运行ulimit -a
'结果如下:
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 1031505
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 99999
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 1031505
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
此外,lsof |wc -l
'结果如下:
14100
我似乎一切都很好,但有时我运行的时候有-bash: fork: Cannot allocate memory
,例如top ls du...
答案 0 :(得分:0)
看起来您的系统交换空间不足。 https://unix.stackexchange.com/questions/41547/linux-running-slow-with-0-swap-left 如果有帮助,请点击竖起大拇指。