node.jsforkcopy-on-write

Do node.js forked processes share any memory via copy-on-write?


In (some?) Unix systems when you fork a process the new process will share memory with its predecessor. The memory will be shared as long as it's unchaged. This is called cow, copy-on-write.

I wonder if Node.js process forking has any technical benefits from cow. If it does then what do Node.js processes share exactly?


Solution

  • No.

    As the documentation says:

    Unlike the fork(2) POSIX system call, child_process.fork() does not clone the current process.