title: Quickly running into high memory usage Node.js
body: <p>I am running a small Node.js server on a Heroku Hobby tier dyno. This tier allocates 512mb of RAM. This service takes in a moderate size of JSON data (~5000 JSON objects, each is ~5kb, 5000*5kb = 25mb), runs some analysis on it and outputs about 20 metrics. It's not a trivial amount of input data but it's also definitely not GBs of files. I'm confused where I'm running into the memory limits here. I run one continuous request for all 20 metrics. Does garbage collection not happen until the end of the request? I'm creating a lot of Date objects probably around 2 per JSON object so about 10,000 total and I do this upfront and save them for the whole process so I'm not constantly re-creating these dates. Could this be the issue I'm running into? Any suggestions for how to optimize there? </p>
  
  <p>By the way, I know Node.js isn't the best tool for data processing in general and we're already looking to move to a Python based server for the libraries and multithreaded environment. But, until that's up and running, I'd love to be able to understand and improve the situation I'm currently running into on Node.js. </p>
  
  <p>Thanks!</p>