material-ui-dropzone icon indicating copy to clipboard operation
material-ui-dropzone copied to clipboard

Memory not released when file is closed

Open primal100 opened this issue 5 years ago • 1 comments

Bug Report

Describe the bug

When large files are added to the dropzone there is a huge surge in chrome memory usage. Even when the file is removed or the DropzoneArea component is unmounted (with clearOnUnmount), the memory usage remains. Adding a large file twice crashes the browser.

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/dawn-microservice-sh97d?file=/src/App.js
  2. Press Shift + L to open the Chrome task explorer and check the memory usage of the codesandbox worker
  3. Add a large file to the dropzone (in my case 354mb), see that the memory usage increases greatly for one of the workers
  4. Remove the file, click the button to toggle the dropzone twice
  5. Check that memory usage remains high.
  6. Add the file again. The sandbox crashes.

In my case adding the same 354mb file twice was enough to crash the browser.

Expected behavior

I would expect the memory usage to go back to normal when a file is cleared or at least when the DropzoneArea component is unmounted. Also I'm not sure if the surge in memory usage when a file is added is normal.

Versions

  • OS: [e.g. iOS] windows
  • Browser: [e.g. chrome, safari] chrome
  • @material-ui/core version: [e.g. 4.9.2] 4.11.0
  • material-ui-dropzone version: [e.g. 3.0.1] 3.4.0

primal100 avatar Sep 17 '20 22:09 primal100

I've noticed this terrible bug too. Hope the PR will the closed soon.

matteodisabatino avatar Jan 05 '21 10:01 matteodisabatino