title: node.js mongoose.js memory leak?
body: <p>I'm creating bower package search site (everything is open sourced) and I hit the wall. I have some memory leak (or I think I have) and I honestly don't know why it is there.</p>
  
  <p>You can download it and run on Your own, but simple hint will help me greatly.</p>
  
  <p>I have narrowed it down to this function call here <a href="https://github.com/kamilbiela/bowereggs-backend/blob/master/main.js#L14" rel="nofollow">https://github.com/kamilbiela/bowereggs-backend/blob/master/main.js#L14</a> (  nest.fetchAndSave() ) which is all defined here: <a href="https://github.com/kamilbiela/bowereggs-backend/blob/master/lib/nest.js" rel="nofollow">https://github.com/kamilbiela/bowereggs-backend/blob/master/lib/nest.js</a></p>
  
  <p>Basically it downloads a package list from internet, Json.parse and inserts it into database, plus some when.js promises.</p>
  
  <p>Running this function few times creates a 30mb of memory per run, that is not cleaned by garbage collector. Also note that this is my first "real" node.js project, so I'll be really grateful for any tip.</p>