DigitalOcean Droplet Out of Memory (OOM Killer)

Share
Workaround available Linux Updated November 13, 2026Based on 3 user reportsHow we research

Quick answer

On 512 MB to 2 GB Droplets the Linux OOM killer ends your biggest process (MySQL, Node, PHP). Confirm with dmesg, add a swap file, trim memory use, or resize the Droplet.

Most likely fix: Confirm it is the OOM killer

How to fix it

Try these in order — the most common fix is first.

  1. 1. Confirm it is the OOM killer

    1. Run sudo dmesg -T | grep -i -E "out of memory|killed process"
    2. Check usage with free -h and top (sort by memory with Shift+M)
    Did this fix it?
  2. 2. Add a swap file

    1. sudo fallocate -l 2G /swapfile
    2. sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile
    3. Add "/swapfile none swap sw 0 0" to /etc/fstab so it survives reboot
    4. Swap on SSD is slow, so treat it as a safety net not a fix
    Did this fix it?
  3. 3. Reduce memory use

    1. Lower worker counts (PHP-FPM pm.max_children, Gunicorn workers) and database buffers
    2. For Node set NODE_OPTIONS=--max-old-space-size to a value that fits
    3. Build locally or in CI instead of on the Droplet
    Did this fix it?
  4. 4. Resize

    1. Power off the Droplet, open Resize, choose a plan with more RAM (a CPU and RAM only resize can be reversed; resizing the disk is permanent)
    2. Check the new monthly price before confirming
    Did this fix it?

Symptoms

Services die randomly, the site goes down, logs say "Out of memory: Killed process", builds fail with "Killed" or heap out of memory.

Why it happens

  • Small Droplet with no swap (Droplets do not ship with swap by default)
  • MySQL/PostgreSQL or PHP-FPM tuned for much larger servers
  • Node build or app exceeds heap
  • Memory leak in your app
  • Traffic spike spawns too many workers

This guide also covers

  • digitalocean droplet out of memory
  • droplet killed process oom
  • digitalocean droplet add swap
  • droplet mysql keeps crashing

Still not working?

If DigitalOcean keeps failing, you're not alone. See every DigitalOcean problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us
Fixed it? Share this guide

Other DigitalOcean errors

All 10 DigitalOcean errors and fixes →