material-ui-dropzone
material-ui-dropzone copied to clipboard
Memory not released when file is closed
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:
- Go to https://codesandbox.io/s/dawn-microservice-sh97d?file=/src/App.js
- Press Shift + L to open the Chrome task explorer and check the memory usage of the codesandbox worker
- Add a large file to the dropzone (in my case 354mb), see that the memory usage increases greatly for one of the workers
- Remove the file, click the button to toggle the dropzone twice
- Check that memory usage remains high.
- 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/coreversion: [e.g. 4.9.2] 4.11.0material-ui-dropzoneversion: [e.g. 3.0.1] 3.4.0
I've noticed this terrible bug too. Hope the PR will the closed soon.