-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible Memory Leak in HTTP #18796
Comments
/cc @mcollina |
I cannot reproduce with Node 8.9.4 using: const http = require('http');
const server = http.createServer(app);
function app(req, res) {
res.statusCode = 200;
res.end('Hello, world!');
}
// Start the server
const PORT = process.env.PORT || 9000;
server.listen(PORT, () => {
console.log(`App listening on port ${PORT}`);
}); (nor I can with heapdump enabled) (diagram generated with http://npmjs.com/clinic) My suggestion is that the problem might be in your application, and not in Node core or Express. In the diagram you posted, you show that the process grows up to 2.5gb. Can you reproduce that kind of growth? |
@mcollina we are constantly restarting the node servers, because every other day the memory reaches those levels. The thing that I don't understand is that we've tried it in 3 differents dev Mac and the servers, but neither you nor the express people can reproduce it. |
Do you see anything weird in the heapdumps I submitted??? |
A heapdump of that size is unlikely to be representative of anything. |
@mcollina that is after some 100.000 requests, I can upload heapdumps with more requests if that would help |
I have run that basic node core server with a 1 billion request, and saw no appreciable difference in the Heap size. Let me ask again: in the diagram you posted, you show that the process grows up to 2.5gb. Can you reproduce that kind of growth? That looks like a memory leak. This example don't, so it seems that it is your application that is leaking. |
No follow-up from OP. I'll close this out so we're below 700 open issues again. :-) |
We haven't had anything new to provide as evidence, so go ahead an close this. Thanks |
We've being experiencing an steady memory consumption in on our servers:
The drops in memory are when we deploy a new version (the server restarts) or we manually restart the servers.
We started to debug, and came to the conclusion that the issue was in express, when we created the issue in express, we tried the same test on a barebone node server and the we had the memory leak.
(There is a lot of information in the express issue)
Platform:
Here is the code:
run with
node --expose-gc server.js
autocannon command
autocannon -a100000 -c5 http://localhost:9000/
I have tested the code for the memory logging and it doesn't leak.
I've attached the heapdump
Archive.zip
The first snapshot is after the server starts and the memory has been stabilized.
The second is after an autocannon run and the memory has been stabilized.
The third is after a second autocannon run and the memory has been stabilized.
Could you help us find out if the issue is really with node?
The text was updated successfully, but these errors were encountered: