Linux Memory Overcommit in PostgreSQL: A Reader’s Question

A systems administrator recently asked about tuning vm.overcommit_kbytes on a PostgreSQL host with 32 GB RAM and 16 GB swap, where HugePages are disabled.

The reader calculated vm.overcommit_kbytes = 32 - 0 - 16, arriving at 16 (GB). This, they noted, equals 50% of physical RAM—the same outcome as the default vm.overcommit_ratio. The concern: the kernel could reject memory allocations before all physical RAM is consumed.

The question posed to the expert: should vm.overcommit_kbytes be set to the full physical RAM size (32 GB) or to a smaller value to avoid premature out-of-memory conditions?