Memory-mapping Ranges Larger Than Available RAM and Swap
When you mmap() a range larger than your system’s total physical memory plus swap, the kernel normally reserves swap space to back the mapping. If that reservation would exceed available swap, mmap() fails with ENOMEM. The MAP_NORESERVE flag lets you bypass this reservation requirement. Understanding the Default Behavior By default, when you call mmap() with…
