VMM fork policy

You can change the way memory dedicated to the process is managed when a process is forked.

The virtual memory manager (VMM) does not copy the entire address space of a process when the process is forked. Pages are copied on demand when they are modified by either the parent or the child process. Load references to pages that are not yet modified are resolved to memory shared between the parent and the child processes. If the page is subsequently modified, it is copied at the time of modification.

If memory is read and immediately written by a process, it is easier to make a copy of the page when it is first referenced rather than when it is first written. This behavior can be used for the entire system by modifying the restricted vmm_fork_policy tunable parameter by using the vmo command. You can override the global tunable parameter with a single process by exporting the VMM_CNTRL environment variable and by specifying the vmm_fork_policy keyword.