Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

142
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda