Calculate virtual address space size and mapping requirements for a process.
Virtual memory lets processes reserve address space far beyond physical RAM, since most allocated virtual memory is never fully touched (sparse allocations, unused stack/heap headroom, shared library mappings). Linux governs how aggressively it allows this via vm.overcommit_memory: policy 0 (default) uses heuristics to permit 'reasonable' overcommit; policy 1 disables checking entirely; policy 2 enforces a strict CommitLimit = swap + RAM × overcommit_ratio%, refusing allocations that would exceed it regardless of how much would actually be used.
Strict commit limit
CommitLimit = swap + physical_RAM × overcommit_ratio%
VIRT counts all address space a process has reserved — including memory-mapped shared libraries, unused malloc arena headroom, and memory-mapped files — most of which is never simultaneously resident in physical RAM. RES (resident set size) is the more meaningful figure for actual physical memory consumption.
With checking disabled, allocations that the system can never actually back with real memory still succeed at allocation time, deferring the failure to when the memory is actually touched — at which point the OOM killer may need to terminate a process, potentially one unrelated to the actual over-allocator.
On systems where predictable failure (a refused allocation) is preferable to unpredictable OOM kills later — for example, memory-critical services where you'd rather an allocation fail cleanly and be handled in application code than have the OOM killer choose an arbitrary victim process under pressure.