5 ms·
When you fork then a complete copy of the parent process is created, including all its memory. This memory is not actually copied until it is changed, but it st
by tsss 2y ago
When you fork then a complete copy of the parent process is created, including all its memory. This memory is not actually copied until it is changed, but it still doubles the virtual memory usage. So without overcommit, even starting bash through a fork would immediately cause an OOM if your process uses more than 50% of physical memory.
- heavenlyblue 2y agoThat's an incorrect assumption though. Overcommit is for pages that have not been accessed yet, however when forking a valid use case is to share pre-loaded, mostly read-only memory between processes.