Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

128
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda