Do not reserve swap space for this mapping. When swap space is reserved, one has the guarantee that it is possible to modify the mapping. When swap space is not reserved one might get SIGSEGV upon a write if no physical memory is available.See also the discussion of the file /proc/sys/vm/overcommit_memory in proc(5). In kernels before 2.6, this flag had effect only for private writable mappings.
I thought swap space is shared by all the processes in the host. After seeing this flag I would like to know:
- Is swap space is pre-reserved for each process? If yes,
- how is the per-process reserve swap space is calculated?
- what will happen if a process exceeds that reserved space? Will that process alone be killed or it will invoke OOM killer (kills a random process).
- Does this option only work with
/proc/sys/vm/overcommit_memory -> 0? - What is the best use case for this flag?