fork: Cannot allocate memory
18,948
Can you provide us with the output of ulimit -a
ran in a session where this happens?
/etc/pam.d/sshd
should involve pam_limits.so
when you open a session. This module will use /etc/security/limits.conf
to apply various restrictions to your session, including regarding memory usage.
Related videos on Youtube
Author by
xrado
Updated on September 18, 2022Comments
-
xrado over 1 year
I am frequently getting:
fork: Cannot allocate memory
when running commands over
ssh
. I have 4 GB of RAM and usually 2 GB free. This started happening since I upgraded to Ubuntu 11.10.I then need to repeatably run the command until it finishes successfully.
I'm connecting from my laptop to my server both from my home LAN. Some times happens even when I run apt-get.
Any idea why?
-
lumbric over 12 yearsI think you have to provide more details otherwise this won't be solveable. I suppose the machine you are describing is the ssh server you are connecting to? (and not the client) When this happens run
free
and post the output here (and what program caused the error) -
Panther over 12 yearsAre you running in a VPS ?
-
xrado over 12 yearsI'm connecting from my laptop to my server both in home lan. Some times happens even when I run apt-get. I'll check free next time.
-
DivinesLight over 12 yearsI am getting exactly same problem, also lots of others. See this: ubuntuforums.org/showthread.php?p=11649751
-
-
J. Starnes over 6 yearsWelcome to askubuntu. You could improve your answer by including an example command to enable swap. From review.