-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Memory leak for https.request() on ECONNRESET #8827
Comments
I have not verified, but there is a possibility that this is related to #8647 - which is not in 6.7.0 |
unfortunately I'm still able to reproduce this bug with node 6.8.0 |
also able to reproduce in 7.0.0 |
I had a look and it's a variation on #8871 (comment). Abridged version: catastrophic memory fragmentation because of how glibc allocates memory. There isn't much we can do about that except switch to a different memory allocator and that is not a trivial undertaking. If you |
This seems to have been fixed by node version 7.2.0 (probably #9626) Can no longer reproduce, closing |
For me this issue was still present in v7.7.4, but fixed in v7.9.0. For posterity: This code causes a large leak (50kb per call which adds up quickly on production):
This code does not leak (
using request package I wish the bug had been better documented — was a critical one in our case as it took our server out of memory about once an hour. |
I'm able to reproduce this on v7.9.0 |
@itslukej Please file a new issue and include steps to reproduce. |
Using http seems to slow down the leak for me vs https, but, it still leaks on v8.9.1 |
This ticket needs to be reopened? |
Wonder if this can be resolved by using this instead??? |
I experience a memory leak when doing https requests to a host that resets the connection.
Reproduce by
node econnreset.js
econnreset.js.txt
node leak.js
leak.js.txt
For me it goes up to 600MB with 10000 requests - and stays that way.
Heapdump is small
npm install heapdump
)require('heapdump')
node econnreset.js
andnode leak.js
kill -USR2 $pid
.The resulting heapdump from a process with 600MB is only 100MB large.
Manual GC call has no effect
global.gc();
node econnreset.js
andnode leak.js --expose-gc
Am I using https.request() wrong or is this an internal problem?
The text was updated successfully, but these errors were encountered: