bash - Running any command returns "Cannot allocate memory" on Ubuntu Server - Ask Ubuntu


i’m using ubuntu 14.04. recently, when login via ssh user sudo privileges, every command run results in “cannot allocate memory” error. here few tried @ console

myuser@mymachine:~$ whoami -bash: fork: cannot allocate memory myuser@mymachine:~$ uname -a -bash: fork: cannot allocate memory 

even if try sudo reboot now above error, don’t know else can try unlock instance. host digitalocean if matters.

edit: per answer/suggestion given here output of "free"

myuser@mymachine:~$ free -bash: fork: cannot allocate memory 

solution

as says in error messages, machine has run out of memory. can number of reasons, basically, eating of memory , not leaving left basic command usage.

i suggest reboot droplet (just go client control panel , select "reboot"), ssh in , run top or htop. keep eye on memory usage , see process using memory. there, try either

  1. killing/removing faulty program/process

    warning: please research on if process essential system process, first! if system process causing memory issues, don't kill it, research on , specific ways deal it.
  2. changing configuration program/process doesn't eat of memory.

suggestions preventing issue happening again

  • something add swap memory, allocates more memory if you're running out.
  • whenever install programs, make sure configure them correctly don't perform in unintended ways (like eating memory)
  • after each time add package or new configured, check htop or top see how memory you're using current programs. if notice you're using of it, try , clear out going through , removing unnecessary programs/processes.
  • if there that's being auto-started (besides system processes, of course!) don't recognize or want auto-started, remove it! research on process before killing/deleting it, essential bootup procedures or system functions, etc.

Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User