Interview Prep/Linux/Storage & Memory

What is memory overcommit?

AdvancedConceptStorage & Memory
Answer

Linux lets processes allocate more virtual memory than exists, betting most will never touch it all. vm.overcommit_memory:

  • 0 (default): heuristic, refuses obviously excessive allocations.
  • 1: always allow (Redis recommends this to avoid fork failures on BGSAVE).
  • 2: strict; commit limit = swap + RAM × overcommit_ratio%. malloc fails instead of OOM later.

Check CommitLimit and Committed_AS in /proc/meminfo.

All Linux questions Roadmap: Linux

More on Storage & Memory