Node16 child processes and memory allocation

Viewed 118

I know that node16 by default allocates 4GB of memory for itself. I can change that with the flag --max-old-space-size

But how is that passed down to child processes, specifically using execFile?

  • Does it spawned process get the value of --max-old-space-size?
  • Or --max-old-space-size is divided by the number of children?
  • Or they are not affected and use the default for Node?

I couldn't find any documentation online about this. Thanks

1 Answers

execFile is a generic way to launch another process. There is nothing that is passed from the Node process to that process except the environment variables. If you use it to launch another node process, it will use the default options unless you specify something else.

Related