I have an Ubuntu machine that works fine most of the time, but every few days one of two things will happen:
- I'll be logged into the machine and start getting a "cannot allocate memory" message anytime I try to run any command
- I'll try to SSH into the machine but I'll get an error that says "Connection closed by remote host"
If I log into my host's web interface and restart the server, the problem will completely go away but it always comes back.
I'm not sure how to troubleshoot this. Every time I do top it looks normal. Any suggestions?
Edit: here is my top output (a couple days in, sorted by memory usage): http://pastebin.com/x1CbFLrA