Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
Are forked processes garbage collected by deleting their reference objects?

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?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

After shifting, is the deleted child process completely garbage collected by the parent process?

No. A child process is an OS level thing, not a Javascript thing. It won't be affected by garbage collection in the way you describe. If you mean for the child to exit, you need to either kill it or send it a message telling it to exit.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!