Vm.overcommit_memory=2 is always the right setting
2 days ago
- #System Administration
- #Linux
- #Memory Management
- Linux kernel's `vm.overcommit_memory` sysctl controls memory allocation behavior.
- Overcommit changes memory allocation contract: successful allocation doesn't guarantee real memory availability.
- Overcommit replaces fail-fast transactional allocation with a best-effort model, deferring failures to memory access time.
- Disabling overcommit ensures allocations fail immediately if memory isn't available, restoring admission control.
- Failure locality is better for debugging; overcommit loses this by design, making failures harder to diagnose.
- Redis warns against disabling overcommit, but requiring overcommit indicates poor error handling in applications.