Open SooOverpowered opened 1 year ago
@SooOverpowered any update on this? I'm very surprised to not see a response on here from nextjs for such a big issue. We've been chasing down memory leaks for a while and I wonder if this is a root issue.
@alex-statsig Hi, I think my codesandbox url is broken, but I think you can replicate it by setting up some kind of file upload to an API route, and try uploading a large file then interrupt the upload. As per my testing with NextJS 13 and earlier version of Next 14, the memory was not released.
Have you just been accepting the memory leak then? The lack of response from nextjs team on issues like this astounds me 😞
Link to the code that reproduces this issue
https://codesandbox.io/p/sandbox/stoic-shadow-pzvg4w?file=%2Fpages%2Fapi%2Fupload.js%3A13%2C3
To Reproduce
Current vs. Expected behavior
When an upload fails, the data stored inside memory for the failed API call should be freed (.i.e through garbage collection or somthing else). However it stays inside the memory indefinitely.
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure
Additional context
I tested this on CodeSanbox, local machine, inside k8s, inside docker, all showing the same problem.