Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!