Does node.js --max-old-space-size include forked processes? Does node.js --max-old-space-size include forked processes? linux linux

Does node.js --max-old-space-size include forked processes?


My team had the same question and so we tested this on our staging server. We use the native node cluster module with forever as a daemon.

For every forked process, appearing in htop, we can see the --max-old-space-size flag being passed along. Each each child process had the flag, including processes forked later on in the app.

We did NOT need to manually pass the flag through cluster module itself.

In other words, if I fork() additional processes from inside the script, does each forked process get 4096MB to work with, or do they all draw from the same 4096MB pool?

I believe this is the case with the tests that we ran at the time.

enter image description here