Axios doesn't address memory leaks?
See original GitHub issueDescribe the bug
I used the latest version of Axios (v0.20.0-0) with interceptors, interceptors.response.use () after that, the sent request will be viewed through the chrome tool. The returned content will always be saved and will not be released. This problem should be very common and should have been solved earlier. Is there a problem with my configuration? I hope you can get a reply. Thank you very much
To Reproduce
Pseudo code
servers.interceptors.response.use();
Expected behavior
I send requests to intercept, but don’t leak memory
Environment
- Axios Version 0.20.0-0
- Browser Chrome
- Browser Version 84.0.4147.125
- Node.js Version 14.0.1
- Additional Library Versions React 16.7
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:22 (6 by maintainers)
Top Results From Across the Web
Memory leak using axios - Stack Overflow
I'm just starting an app using reactjs and axios. It fetches some rather big JSON data and after a few minutes, Chromium stops...
Read more >Cancel all axios requests in React's componentWillUnmount ...
This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the...
Read more >How to fix the React memory leak warning - DEV Community
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your...
Read more >Preventing memory leak by handling errors and request ...
When making a network request with axios in a React app, you will likely update your state based on the response of the...
Read more >axios 浏览器内存泄露问题解决- JadePeng - 博客园
到axios issues搜索,发现 memory leaks 帖子不少,典型的在这里Axios doesn't address memory leaks?: 这里提到 0.19.2 版本没有问题,但是升级到 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m on version 0.21.1 and encountering this issue. The data from the responses isn’t being garbage collected.
We were using 0.19.2 with no issues. We bumped to 0.20.0 and an issue arose with a box running out of memory and crashing. We used interceptors and found the response was not being released, as you described. Slowly leaking and eventually dying. We reverted back to 0.19.2 and everything seems to have gone back to ok. I cannot speak for 0.18.1 myself as this was for a prototype and we never used 0.18.1 on it so there may have been bug fixes in between 0.19.2 and 0.18.1.
Otherwise if you’re still having issues on 0.19.2 we may have had different root issues. I have never really used axios, so you’re probably way ahead of me if it’s a config thing. I was just the unlucky person assigned to finding the issue 👍