-
-
Notifications
You must be signed in to change notification settings - Fork 984
Large increase in memory usage in v9.4.0 #690
Copy link
Copy link
Closed
Labels
bugSomething does not work as it shouldSomething does not work as it shouldexternalThe issue related to an external projectThe issue related to an external projectregressionSomething does not work anymoreSomething does not work anymore
Metadata
Metadata
Assignees
Labels
bugSomething does not work as it shouldSomething does not work as it shouldexternalThe issue related to an external projectThe issue related to an external projectregressionSomething does not work anymoreSomething does not work anymore
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.0andv9.4.0we 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 that0in this case means "no timeout", so that we end up in a situation where there are a lot more connections open consuming memory?Checklist