I am getting a memory leak when I prevent a file from loading fully loading. E.g.
<script type="text/javascript" src="http://mydomain.com/js/lib.js"></script>
(node) warning: possible EventEmitter memory leak detected. 11 listeners added.
Use emitter.setMaxListeners() to increase limit.
Trace
at Socket.EventEmitter.addListener (events.js:160:15)
at Socket.Readable.on (_stream_readable.js:663:33)
at Socket.EventEmitter.once (events.js:179:8)
at TCP.onread (net.js:527:26)
And when I remove this line I stop getting memory leaks:
app.use(express.static(__dirname + '/public')));
How can I try to solve this?
I solved the issue by using nginx to serve static files! Might just be a temporary solution, but it works.