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
Axios response memory leak #3457
Comments
I have similar indications. In node.js, after doing an If at exit point logging Same behavior when setting http(s)Agent with Nodejs 12 & 14, axios 0.19,0.20,0.21.1 |
I have been investigating a similar issue. I'm currently testing using a more robust script of:
Ran with: Your script is prone to memory build-up due to it not waiting on the response before starting the next. The number of requests in flight can increase if the request time increases. I wasnt able to replicate any issue with my script, I tested up to 22,422 requests. |
The following however does lead to an eventualy crash.
Ran with: So it appears the leak is tied to timeouts or failed requests. |
Further troubleshooting narrows it down to |
follow-redirects v1.13.3 fixes this |
This has been fixed with #3694 |
Hey you guys sure this is fixed? I thought I'd give Axios a try instead of the actual HTTP client of Nodejs, yet I see my ram jump skyhigh when retrieving 5mb responses from a backend server using a post command: I call these functions sequentially. After one is finished the next starts. This always retrieves the same response with binary data of abount 5 megabytes. My axios function:
When doing something 'similar' in the http library, my ram stays levelled.
|
Seems like the bugFix #3694 is merged to master on March 23, but still we got no version release after that. |
i used 0.27.2 version to test @Dirk94's original test, it still have memory leakage. |
I just upgraded to |
Can't reproduce on my own. Do u still have this leakage? |
Reproduced on v1.4.0 |
Describe the bug
I think that Axios has a serious memory leak. The Axios responses are never removed from memory.
To Reproduce
Create a new node project.
Expected behavior
I would expect this program to not keep a reference to every response. But unfortunately, it does.
Environment
Additional context/Screenshots
The Chrome memory profiler shows that the Wikipedia responses are stored in memory.
The text was updated successfully, but these errors were encountered: