nodeJS throws heap out of memory exception while iterating large json file?

I have a situation where i need to process large json file (array of json objects) in nuxt3 application.

While iterating the large JSON file. node throws javascript heap out of memory exception. To counter this, I converted the large JSON into smaller chunks and tried processing it. It still fails and gives the same exception.

I also tried to build nuxt app with NODE_OPTIONS=--max_old_space_size=8192 nuxi build It doesn’t help either.

Is there any way to handle this better?