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

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)

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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

I used the suggestions at to resolve this issue.

A few notes to help clarify:

  1. Update your my.conf file to something similar to below (tweak as desired):
# Note the new values are after the included files below
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/


read_buffer_size             = 60K
sort_buffer_size             = 1M
innodb_buffer_pool_size      = 64M
tmp_table_size               = 8M
max_connections              = 25

  1. If you want to run the script that was shared at the bottom of the linked webpage, you need to save it as a file (e.g. sudo nano mysqlinfoscript), and you may want to add some mysql credentials to the first uncommented line (replacing the username and password) as below:
mysql -u username -p'password' -e "show variables; show status" | awk '
  1. To execute the script (assuming you named it mysqlinfoscript) run:
bash mysqlinfoscript
  1. It’s unsafe to leave the username/password in the script so you may want to remove that when finished.

5.) You’ll need to restart mysql after updating my.conf:

sudo service mysql restart


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.