Question

My droplet is out of memory

Posted April 22, 2021 352 views
DockerPostgreSQLUbuntu 18.04

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

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.

×
Submit an Answer
2 answers

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

  • Thanks for your response. I’m presently using an 20$ droplet. However, the memory is getting full due to utilization of RAM. In this regard, one option I found is to increase the swap size. looking forward for suggestions.

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

by Brian Boucheron
One of the easiest way of guarding against out-of-memory errors in applications is to add some swap space to your server. In this guide, we will cover how to add a swap file to an Ubuntu 18.04 server.