Answer the question
In order to leave comments, you need to log in
What to do if an array in a variable takes a lot of RAM?
There is an array of data
const array = [
{
a: "test",
b: "test",
c: "test",
}
// ... 6200 elements
]
node --max-old-space-size=32000 dist/index.js
it, but it's still not an option, since the array can reach up to 20k+ elements, is it possible to somehow optimize this? Answer the question
In order to leave comments, you need to log in
I read the file through without specifying the encoding
fs.readFile(path.join(__dirname, '..', '..', 'test.txt'))
fs.readFile(path.join(__dirname, '..', '..', 'test.txt'), 'utf-8')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question