title: Why is this http server described as leaking?
body: <p><a href="https://www.nearform.com/blog/how-to-self-detect-a-memory-leak-in-node/" rel="nofollow noreferrer">This</a> web site describes the http server implementation below in a post about memory leaks. What's wrong with it? </p>
  
  <pre><code>const http = require('http');
  
  var server = http.createServer((req, res) =&gt; {
   for (var i=0; i&lt;1000; i++) {
   server.on('request', function leakyfunc() {});
   }
  
   res.end('Hello World\n');
  }).listen(1337, '127.0.0.1');
  server.setMaxListeners(0);
  
  console.log('Server running at http://127.0.0.1:1337/. Process PID: ', process.pid);
  </code></pre>