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 →
SegfaultOOM Killed
Signal / exit codeSIGSEGV / 139SIGKILL / 137
Who decidedThe CPU/kernel on an invalid accessThe kernel OOM killer
EvidenceCore dump, backtracedmesg: Out of memory: Killed process
FixFix the code / native extensionMore RAM/swap, lower memory use, fewer workers

Rule of thumb

Exit 139 → debug the program. Exit 137 → check memory limits and the kernel log.