mongod killed by OOM killer MongoDB Origin: Data OSI layer 7 · Application Last updated 5 Nov 2026

MongoDB: Out of memory: Killed process (mongod) — WiredTiger cache + queries exhausted RAM

The Linux OOM killer terminated mongod because the host ran out of memory.

Exact message you may see Out of memory: Killed process mongodmongod.service: A process of this unit has been killed by the OOM killerKilled process 1234 (mongod) total-vmmongod OOM killed container exit code 137WiredTiger cache memory exceeded OOM
Seen on: MongoDB Linux

Meaning

Check dmesg | grep -i "killed process". Limit the WiredTiger cache (storage.wiredTiger.engineConfig.cacheSizeGB), especially in containers where MongoDB reads host RAM instead of the cgroup limit (older versions). Avoid huge in-memory sorts/aggregations, add indexes, and size the host properly with swap off for DBs but enough RAM.

Common causes

  • Container memory limit smaller than WiredTiger default cache
  • Large aggregations without indexes (allowDiskUse needed)
  • Other processes sharing the host
  • Too many connections (each uses memory)
  • Undersized instance

⚡ Quick fix

  1. Set cacheSizeGB to ~50% of available RAM (or lower in containers)
  2. Add indexes; use allowDiskUse: true
  3. Move to a larger instance or isolate mongod

Detailed fix by platform

Linux

  1. dmesg -T | grep -i -E "killed process|out of memory"; free -h

How to diagnose

  1. dmesg — OOM entry?
  2. Cache — Configured?
  3. Queries — Heavy aggregations?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

Atlas: bad auth: Authentication failed — MongoServerError: bad auth : Authentication failed. (Atlas user / special characters in password) (MongoDB)Atlas: bad auth: Auth…BSONObj size is invalid / exceeds maximum document size (16MB) — MongoServerError: BSONObj size: 17825792 (0x1100000) is invalid. Size must be between 0 and 16793600(16MB) (MongoDB)BSONObj size is inval…Can't connect from another host (bindIp 127.0.0.1) — MongoDB: connection refused / timed out from a remote host — mongod bindIp defaults to 127.0.0.1 (MongoDB)Can't connect from an…Cannot allocate memory — fork: Cannot allocate memory / ENOMEM (Linux)Cannot allocate memoryExecutor error: Sort exceeded memory limit (find().sort) — MongoServerError: Executor error during find command :: caused by :: Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting (MongoDB)Executor error: Sort …heap out of memory — FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory (Node.js)heap out of memoryJupyter kernel died — The kernel appears to have died. It will restart automatically. (Python)Jupyter kernel diedMaxListenersExceededWarning — MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 listeners added (Node.js)MaxListenersExceededW…mongod ki…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.