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

High Browser Memory Usage while uploading Large Files #9559

Open
kapilbarad opened this issue Nov 27, 2024 · 0 comments
Open

High Browser Memory Usage while uploading Large Files #9559

kapilbarad opened this issue Nov 27, 2024 · 0 comments
Labels
status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@kapilbarad
Copy link

kapilbarad commented Nov 27, 2024

Describe the Bug

Uploading large files crashes the browser due to high memory usage.

Link to the code that reproduces this issue

https://github.com/kapilbarad/payload/tree/payload2-upload-high-memory-usage/examples/media

Reproduction Steps

  1. Start the server by following these steps - https://github.com/kapilbarad/payload/tree/payload2-upload-high-memory-usage/examples/media#development
  2. Create a new Media from media Collection
  3. Try to upload a big file more than your browser can read, for me it was 2GB depending on the system you're on
  4. You'll notice the Crash or Hang of the Browser

This is happening because the Payload 2.0 Upload Component is trying to display the image preview of the selected file by reading the file, without checking its type. Ref: https://github.com/payloadcms/payload/blob/2.x/packages/payload/src/admin/components/views/collections/Edit/Upload/index.tsx#L77

Which area(s) are affected? (Select all that apply)

  • Core UI
  • File Upload

Environment Info

Payload: 2.30.4
NodeJS: 18.17.1
@kapilbarad kapilbarad added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Nov 27, 2024
@kapilbarad kapilbarad changed the title File Upload: Reduce Memory Usage to fix browser crashes File Upload: High Memory Usage on Big file Upload Nov 27, 2024
@kapilbarad kapilbarad changed the title File Upload: High Memory Usage on Big file Upload High Memory Usage on Big file Upload Nov 27, 2024
@kapilbarad kapilbarad changed the title High Memory Usage on Big file Upload High Memory Usage while uploading Large Files Nov 27, 2024
@kapilbarad kapilbarad changed the title High Memory Usage while uploading Large Files High Browser Memory Usage while uploading Large Files Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

1 participant