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

192
Vistas
Managing Memory of JavaScript Arrays. Does Splicing arrays remove the forgotten data from memory?

I'm creating a relatively simple but very useful web application that goes through ALOT of data (small JSON/js objects). I couldn't find any database services that were stored locally that were to my liking. I came up with this solution.

Context: The client simply gets the data from an API that I'm creating and analyzes for the user, all the data is meant to be stored in the server of course. An instance of the following class I will describe collects about 100k data objects a day on average. Until further development, the client will only be allowed access to the last 24 hours' worth of real-time data.

The class I created collects the data in an array and posts the data to the API, but because of the sheer amount of data, I'm concerned with memory over the long haul. My solution is every day, for the class to save the data in a timestamped JSON file in a folder designated for the instance of that class. For example, if this instance is tracking ETHUSDT data, each json file would be named something like 'ETHUSDT_m100k_10/15/2021-10/16/2021.json'. Then with the array, delete any data older than a day, so that the array doesn't take up too much memory. This way, the class can still post a day's worth of data to the API, without losing data after a day and maintain a sizeable array.

My concern is that the data spliced from the array will still be left in memory without a reference. Is this the case? I've only begun learning to code this February and am self-taught, so I understand there will be gaps in my knowledge. I know the JS garbage collector is pretty good, but I wrote a similar program in Python and with the same tactic, the memory still continued to grow.

Sorry for the long explanation for a simple question. In other words:

Is data removed from an array left in memory?

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