I\'ve read through a number of SO questions about nodejs running out of memory, but I haven\'t seen anything that sounds similar to my situation.
I\'m trying to process
You have the right Idea of using streams but i think you missed something on the way, I suggest you the following article to update the streamInterface, and events. https://coderwall.com/p/ohjerg/read-large-text-files-in-nodejs
An other source of problem could be the mongodb, it seems you make a lot of inserts, it could be related with the max i/o of mongodb that exhaust the memory.