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

137
Vistas
Promise.race crash - expected or v8 bug?

This function will eat memory and eventually crash node. Is that the expected behavior or a bug in v8?

async function crash() {
  for (let i = 0; i < 10000; i++) {
    await Promise.race(new Array(10000));
  }
}

I'm guessing every iteration creates 10,000 new tasks but only waits for 1 of them to execute leaving 9,999 tasks behind which will accumulate and fill up the memory. But shouldn't those left behind tasks get executed and therefore be removed from memory once Promise.race is called in the next iteration?

about 4 years ago · Juan Pablo Isaza
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