Getting regular "Out of memory: Kill process". How to resolve this isse?

Posted July 30, 2013 66k views
Regularly I got the following message in syslog file: "Out of memory: Kill process 837 (mysqld) score 59 or sacrifice child". This is really annoying. I already created a swapfile using this tutorial "" but I still get error. Could you please tell me how to fix this issue? My droplet is a $5 one with 512Mb RAM. THe distro is Ubuntu 13.04 x64. (the funny thing is that default mysql configuration worked perfectly on my previous server (VPS Gandi with only 256Mb RAM)
  • I’m getting the same thing on $10 plan for apache2 (running wordpress and have basically zero traffic except for myself.

  • Try disabling OOMKiller using this command:

    echo 1 > /proc/sys/vm/overcommit_memory

    You can make it permanent with /etc/sysctl.conf by adding vm.overcommit_memory = 1 and then running sysctl -p

    Just be aware disabling OOMKiller will have negative effects if you actually run out of memory.

    I found even with loosening the ratio to 60% it still killed off my processes with less than 60%.

    Disabling it entirely by setting to 1 fixed my problem I think :)

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

32 answers

Try to use a swap file.
Getting this error with a nodejs process et resolved since using a swap

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.

Follow the swap tutorial. It solved it for me. I have the 5$ droplet and it works fine now :)

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.

Restarting apache2 and mysql is only a temporary solution, not fixing the root cause.

You can try tweaking /etc/mysql/my.cnf or resizing your droplet to a larger plan.
It might not necessarily be a MySQL problem. Sometimes, other programs hog a server's memory - leaving MySQL too little memory to work with.

Are you running Apache? If so, you should fine-tune Apache2 and MySQL memory usage.

Is it too late for you to copy the config from VPS Gandi, so you can compare it to the config on your droplet?

Guys, I have the same problem.
“You can try tweaking /etc/mysql/my.cnf”
“You should fine-tune Apache2 and MySQL memory usage”

  • is there any step by step explanation of these two?

Thank you!

Same problem here. on $20 per month plan and zero traffic, mysql (on wordpress) keeps stopping (out of memory).

I have the same issue… Really annoying.

I have the same issue… Really annoying. on $10 per month plan

I am facing same issue with $5 plan. My website is not working even. Can anyone from digital ocean helps us here.

I guess this has something to do with DO infra. My Server was running for 2 years with no prob and since last week it is having the same issue. I upgraded to $10 and things are the same

Been fine for the last one year, but got this same issue since last week, plan to upgrade, but it seems will cancel it if has the same issue with @revel .

Any further update?

Thank you.

Same issue…very annoying…can we get something to work [while I migrate everything to AWS]?

Same issue here…

If I use the terminal, I get this error:
“sshexchangeidentification: Connection closed by remote host”

If I try to use the Online Console, every command gets an error like:
“Out of Memory: Kill process … or sacrifice child … ”

What should I do? My server is offline for 3 days and I can’t get it working!
Any help?? Thanks!

Same problem. Have to do “shutdown -r now” several times per day as MySQL seems to get killed often. I considered upgrading to a larger plan but see others are having the same problem with larger plans. I’m surprised there’s no solutions since the months this has been an issue.

Same Issue here!, new website on DO, worked for a month or so then started crashing every day, move it to a new droplets, was fine again for a week now the problem has returned.

Tried to upgrade to a better spec, did not make a difference.

This seem to be a common issue, no response from DO? time to move to another host?

Also getting this, wordpress on 10$,

I am also getting the same thing with the $10 Wordpress plan. Seriously considering moving to a different host.

same here, digging around for answers and I see there has been none given to this question yet…

I too have the same problem, Is there an answer from support team..? It was working fine till last couple of months. What is going on..?

It’s a problem with the servers cgroup configuration.
Disabling cgroups would solve the problem.

Facing the same issue :/

@digitalocean are you going to help your clients or just keep ignoring them ?!

Facing the same issue…

I am facing same issue with $5 plan. My one-click owncloud is not working fine. Very disappointed things.

Same issue here. It’s causing issues with supervisor and database queues, need to be manually restarted daily. I am very surprised DO support has not responded. I may consider migrating to Vultr if I cannot find a solution soon.

Didnt knew about Vultr, I’m opening an account right now there to check it.

The apparent solution is to make a swap file, but the tutorial indicates that a swap file will degrade the SSD drives over time and they dont recommend doing it anywhere and just “upgrade” to fix whatever problem you have.

Looks to me that DO just want people to pay more or cutoff many $5 plans to get bigger customers.

The same problem, just want use wordpress with apache and mysql for my blog. Using droplet for $5
No solutions?

After a bit of digging with information from crash logs and internal mail, I came across this:

I just solved it by using this two commands line:

sudo service apache2 restart
sudo service mysql restart

Good morning, I have the same problem the mysql stops for no reason I have the most basic plan, how the problem is solved.


Just encounter the issue.

I tweaked the default mysql.cnf installed and configured with the Wordpress Droplet config provided by DO.

If the issue disappeared definitively I will update here on the methodology.

I did not go with the swap file path as it was not recommended by DO.


  • Hello, after few weeks I can confirm that this settings works like a charm.
    Going to test it on an other instance which has similar trouble in order to confirm.

    • Hey @gabrielstuff ,
      Any chance you can share what you did if it is still working for you? I really need a fix. Happening on both of my sites hosted on different DO servers. Really struggling to troubleshoot this one

Submit an Answer