-
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
Response strings and closures objects leak with http.Agent enabled (Memory Leak) #9530
Comments
Any update on this issue ? |
You should post a standalone (no third-party modules) test case if you want people to take a look. |
@bnoordhuis - is http.Agent a third party module for NodeJS ? Are there any existing http performance tests I can adapt ? |
|
I recently came across this same issue (memory leak in 6.9.1 that's not there in 6.2.2) that I too I then came across PR#9440 (#9440) which fixes it. Agent is not at fault, but it is the one that's retaining the sockets. The sockets accrue callbacks, |
I infer from the fact that #9440 landed that this can be closed. Please let me know if that's incorrect. Closing now. Thanks! |
http.Agent based sockets pool is leading to memory leaks. With http.Agent enabled, both response strings and response handlers (closures) are not getting released so quickly -- all these objects and closures are getting promoted to old generation. Even on a normal load of 2-3 requests per second, garbage collection is not able to free these promoted objects an closures, application's memory usage reaches to 1GB in just 10-12 hours of run -- eventually application crashes due to out of memory.
Pool settings are normal --
I have done comparison of heap snapshots at various time points to reach to this conclusion. I have even verified that with default agent settings (that is http.globalAgent), I do not see any such behaviour - application memory remains consistent at ~90-95Mb
Below are screenshots from chrome developer tools for various scenarios --
Please guide how can I help quick resolution of this issue.
The text was updated successfully, but these errors were encountered: