linux bash,出现错误无法分配内存,尽管有足够的内存,为什么?

问题描述:

有时我得到了一个错误-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 linux bash,出现错误无法分配内存,尽管有足够的内存,为什么?

也许它有某事。做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时,我有时会运行commonds ,如top ls du...

+1

https://askubuntu.com/questions/73427/cannot-fork-error-messages –

+0

'ps -eL | wc -l'显示太多的线程,我明白了! – user1337896

它看起来像你的系统交换空间不足。 https://unix.stackexchange.com/questions/41547/linux-running-slow-with-0-swap-left 如果有帮助,请点击赞许。