droplet keeps running out of memory

November 2, 2014 3.2k views

I have a droplet with 1GB of memory on which I only run an email server.
every couple of days I have to restart the server because I can't ssh into it:
"ssh_exchange_identification: read: Connection reset by peer"

when I use the web-based console to login, and after I am dropped into the shell, I am unable to run any command:

$ ls 
zsh: fork failed: cannot allocate memory

since I am not running any other services (such as DBs) I believe 1GB of RAM should be plenty to run an email server, so I was wondering if this issue is caused by something else.

1 comment
2 Answers

cannot allocate memory

Your droplet is running out of memory. It's possible that you're using a program that has a memory leak or one that simply needs a lot of memory. Try adding swap to your droplet: How To Add Swap on Ubuntu 14.04 | DigitalOcean.

by Justin Ellingwood
Swap space can be used as an "overflow" area for your system when you run out of RAM. The operating system can store data that would normally be kept in RAM on the hard drive in a specially formatted file. In this guide, we'll demonstrate how to create and use one of these files in Ubuntu 14.04.

The issue was a buggy 'auto_ssh' script from another linux box that created a new connection every 5 minutes without checking for an active one,

Have another answer? Share your knowledge.