Report this

What is the reason for this report?

My droplet is out of memory

Posted on April 22, 2021

I have a docker image and my instance is out of memory error.

Error:

Out of memory: Killed process 2523954 (node) total-vm:1906512kB, anon-rss:1026256kB, file-rss:0kB, shmem-rss:OkB, UID:0 pgtables:4992kB oom_score_adj:0


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!

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.

A $5 droplet isn’t enough to host Docker apps. I upgraded to a $10 instance and these errors doesn’t show up anymore.

Hi @rameshbhalla81,

Do you have SWAP configured? If not I would recommend you to do so.

Swap is an area on a hard drive that has been designated as a place where the operating system can temporarily store data that it can no longer hold in RAM. Basically, this gives you the ability to increase the amount of information that your server can keep in its working “memory”, with some caveats. The swap space on the hard drive will be used mainly when there is no longer sufficient space in RAM to hold in-use application data.

You can follow this tutorial here to see how you can add it:

https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-18-04

Regards, KFSys

Heya,

I’m sorry to hear about your experience. If you’re having issues with processes being killed due to memory issues you can start with examining the logs and also monitor the resource usage on your droplet.

You can check this article on how to monitor the resource usage on your droplet:

https://www.digitalocean.com/community/tutorials/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources

Tools like MySQL Tunner can help you to optimise the configuration of the MySQL service by adjusting the values in the my.cnf file.

You can find more information about the MySQL tunner script in this mini tutorial here:

https://www.digitalocean.com/community/questions/how-to-tweak-mysql-mariadb-configuration-for-increased-performance-and-stability

Adding a swap file can also benefit the performance.

https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-22-04

Regards

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.