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

112
Vistas
Is there a way native javasacript way to prevent excessive memory usage without await in loops?

I see that ES Lint is discouraging the use of await in loops, but I don't see any other native-language based option to prevent randomly excessive memory usage when the process inside the loop requires a lot of memory.

I understand that this could be prevented with the use of promise queues, but those have to be implemented or imported in a library.

Why are they promoting this kind of reckless use of memory and resources?

If I run all the processes "at once" with Promise.all() when each process can consume a highly random amount of memory, and there could be a huge amount of items to process, the script will likely crash, wouldn't it?

Or can you confirm if when using Promise.all() javascript will handle the memory properly to ensure that the memory is not exhausted by running all processes at once?

And what if the process opens network connections and have millions of items to process? I can easily hit the maximum network connections of the OS, and would have to put in place more mechanisms to queue those.

Why is it so wrong to use a simple await in a loop? They say the only reasonable reason for using awaits in a loop is when the iterations need information from each other, but just to prevent excessive resource consumption seems reasonable enough to me, isn't it?

Is there an alternative language-native way to run asynchronous heavy processes over a large list of items without risking excessive resource consumption?

Am i misunderstanding the ES Lint recommendations?

Here is the link: https://eslint.org/docs/rules/no-await-in-loop

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