Array Size Limit


I am currently testing my nodejs code but i encountered an issue where my code was stuck in a “killed” and restart loop. What my code does is reading my database from firebase and store them in an array. However, my database has quite a large number of data which is about 20k of datasets. I tried my code locally and no issue is encountered, so i wonder whether there is a limitation on the allowed array size in glitch.

Hi Erik,

we’re currently limiting the RAM usage of projects to 512MB. An array of 20K elements might well exceed that limit, and in that case the process would be killed. You might be able to query the data in chunks, but I don’t know the details of your project :slight_smile:.

Hi etamponi,

Thanks for your reply. I save my retrieved data from firebase database is because i want to minimize the download usage so i just download all data and store them inside an array which is stored locally. My data is basically some readings with a timestamp attached to each reading. I might need to access these readings so i just retrieve all data nd stored them in an array just incase. I am new to programming so i;m not sure this will cause high ram usage. Do you have any other suggestion? Thank you very much.

1 Like

Hi Erik,

do you mind sharing your project name, so that I can look into it?

You mean the coding? i have set it private and it is quite long…