-
-
Notifications
You must be signed in to change notification settings - Fork 935
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
Large increase in memory usage in v9.4.0 #690
Comments
|
Can you provide any data? How much? |
In After a while we also see the following messages, not sure if that is directly related to the issue: |
Run Node.js with |
I was able to create a concise example that reproduces the issue: https://github.com/voldern/got-memory-leak. Check out the repo above, run The issue is not reproducible when not using the
|
Same with v9.5.0. |
Indeed, somehow |
|
After removing
|
Reproducible without |
So this should be reported to nodejs/node? |
@timdp Yup. Would you be interested in submitting an issue? |
Sure. I'll get on it later today. |
I'm not crazy about how you call But you were saying earlier that #694 doesn't fix it? |
I'll look at it.
Yeah, I'm sure. I'll try to rewrite @voldern's example to use only the native
Please quote? I don't recall saying anything like that. |
Thanks for the clarification and the patch. 👍 I'll turn it into a bug report with Node today. |
I got here through a link in a Got file "timed-out.js". I'm a beginner and just like a curious cat I found things in the archives. About notice: Line 61: \got\dist\source\core\timed-out.js I saw this warning about memory leak. I looked more about the use of this function and found a file that uses this problematic function when using http2. Line 659: \got\dist\source\core\index.js This file "index.js" is using the function as specified as problematic "request.setTimeout(0)" on line 659. So I don't understand if the code is correct or someone forgot to correct this function. My application has a random memory leak that happens after a few hours of use by calling an external api using Got with http2 enabled. Could this have to do with the memory leak I get? Got 14.2.1 I'm just a beginner in programming. I report this in #2351 |
Describe the bug
Problem
We started seeing a large increase in memory usage in our code after updating to the latest version of got in code that is running a few hundred requests a second. After testing every commit between
v9.3.0
andv9.4.0
we were able to narrow it down to this one: https://github.com/sindresorhus/got/pull/659/files.In our setup we are running got configured with timeout, retries and http-keepalive.
Code to reproduce
I'm working on trying to isolate the case into one that is reproducible outside of our code base. It seems to start leaking when there are requests that timeout.
I'm creating this issue now in case someone is able to look at the commit above and understand why it causes memory usage to increase.
Question
What is the purpose of setting
request.setTimeout(0)
after the request is canceled? Could it be that0
in this case means "no timeout", so that we end up in a situation where there are a lot more connections open consuming memory?Checklist
The text was updated successfully, but these errors were encountered: