Segmentation fault vs Killed (OOM): exit 139 vs 137
Both end a process abruptly without a normal error. A segfault is a memory-access bug inside the program; an OOM kill is the kernel reclaiming memory from a healthy-but-hungry process.
Segfault
Segmentation fault (core dumped)
A program accessed memory it wasn’t allowed to, and the kernel killed it with SIGSEGV (exit code 139).
Causes & fixes →
OOM Killed
Killed / Out of memory: Killed process (Linux OOM killer)
The kernel ran out of memory and killed a process to recover — the program just prints “Killed” (exit code 137).
Causes & fixes →| Segfault | OOM Killed | |
|---|---|---|
| Signal / exit code | SIGSEGV / 139 | SIGKILL / 137 |
| Who decided | The CPU/kernel on an invalid access | The kernel OOM killer |
| Evidence | Core dump, backtrace | dmesg: Out of memory: Killed process |
| Fix | Fix the code / native extension | More RAM/swap, lower memory use, fewer workers |
Rule of thumb
Exit 139 → debug the program. Exit 137 → check memory limits and the kernel log.