I have a service that needs to keep multiple forked processes in a round robin. When I am done with one process, I do not call child.kill(), instead I simply shift an array (delete the reference object) that contains the child objects.
uses node v11.0.0
const children = [
child_process.fork('../script.js'),
child_process.fork('../script.js')
];
console.log(
children.map(c => c.connected)
); // [true, true]
child.shift();
console.log(
children.map(c => c.connected)
); // [true]
After shifting, is the deleted child process completely garbage collected by the parent process?