I have a server that is not a virtual machine, and has plenty of RAM (32GB) and its using less than 6, but I constantly get this error when running some programs.
root@DAL1-727]# free -m bash: fork: Cannot allocate memory
if I then kill something benign (like an extra bash session I had open in screen) I can get it to let me do things:
[root@DAL1-727]# free -m total used free shared buffers cached Mem: 32067 5015 27052 0 55 1293 -/+ buffers/cache: 3666 28401 Swap: 16095 0 16095
I'm opening a lot of files and apache is probably the cause. I've tried setting my file limits higher, but this still happens.
ulimit -n 1048576
output of /etc/security/limits.conf
soft nproc 65535 hard nproc 65535 soft nofile 65535 hard nofile 65535 apache hard nofile 64000
What else could this be?