Skip to content
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

fix(upload): Do not read chunks into memory but just stream file chunks #1153

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Apr 12, 2024

Instead of reading file chunks into memory and then upload those chunks, we should rather just slice the file and stream it for uploading. This prevents browsers to sky rocket the memory consumption.

We no longer need p-limit so drop that dependency.


You can test this by uploading a large file and monitor the process memory of your browser. Please note that Firefox has a browser bug: As long as the dev tools are open the request data is not freed so if you have the dev tools open you will still suffer this issue.

Instead of reading file chunks into memory and then upload those chunks,
we should rather just slice the file and stream it for uploading.
This prevents browsers to sky rocket the memory consumption.

We no longer need p-limit so drop that dependency.

Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux added bug Something isn't working 3. to review Waiting for reviews labels Apr 12, 2024
@susnux susnux merged commit 221903f into main Apr 15, 2024
16 checks passed
@susnux susnux deleted the fix/do-not-read-chunks-into-memory branch April 15, 2024 10:25
Copy link
Contributor

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome @susnux !!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Browser console error net::ERR_OUT_OF_MEMORY when uploading large files
3 participants