title: NodeJS / ExpressJS Memory Leak
body: <p>I've a static ExpressJS Server like that:</p>
  
  <pre><code>var express = require("express"),
      app = express();
  
  app.use(express.static(__dirname));
  
  app.listen(1050);
  </code></pre>
  
  <p>When i start the server it uses 20MB of v8 heap. If i do a page reload every second the heap used grow continuously. After 4 hours it goes to 40MB of v8 heap used. The total v8 heap goes to 80MB and the RSS (total memory used by the process) goes to 130MB.</p>
  
  <p>Why this simple and static server uses so much ram? It seems a memory leak. If i don't stop the page reload, the used memory keeps growing.</p>
  
  <p>It's impossible to do larger projects if a simple static server like this uses too much ram.</p>
  
  <p>NodeJS version: v0.10.21
  ExpressJS version: 3.3.5</p>
  
  <p>EDIT: I noticed that it's a problem with NodeJS, because i tried node-static instead of express, and while the used/total V8 heap stayed constant, the RSS memory used by nodejs continued to grow up.</p>
  
  <p>Screen: <br>
  <a href="https://www.dropbox.com/s/4j5qs3rv2549dix/Screenshot%202014-03-20%2014.06.57.png" rel="noreferrer">https://www.dropbox.com/s/4j5qs3rv2549dix/Screenshot%202014-03-20%2014.06.57.png</a>
  <a href="https://www.dropbox.com/s/0c30ou8l3rv2081/Screenshot%202014-03-20%2014.07.54.png" rel="noreferrer">https://www.dropbox.com/s/0c30ou8l3rv2081/Screenshot%202014-03-20%2014.07.54.png</a>
  <a href="https://www.dropbox.com/s/5be1isk4v70qj8g/Screenshot%202014-03-20%2014.08.10.png" rel="noreferrer">https://www.dropbox.com/s/5be1isk4v70qj8g/Screenshot%202014-03-20%2014.08.10.png</a> <br>
  (Starts at 13:48)</p>