PostgreSQL

Linux memory overcommit can cause OOM killer to terminate PostgreSQL

critical
Resource ContentionUpdated Feb 12, 2026
Technologies:
How to detect:

On Linux systems with default memory overcommit settings (vm.overcommit_memory=0), the kernel may invoke the OOM killer when memory pressure is high, potentially terminating PostgreSQL processes even when the database is operating within configured limits. This causes immediate connection loss and potential data inconsistency.

Recommended action:

Set vm.overcommit_memory=2 and configure vm.overcommit_ratio appropriately (typically 50-80) in /etc/sysctl.conf to prevent overcommit. This ensures PostgreSQL malloc failures are predictable rather than allowing the OOM killer to terminate processes. Requires system reboot or 'sysctl -p' to apply.