Memory Leak of FileReader readAsArrayBuffer
Reported by
baptiste...@imascap.com,
Feb 28 2018
|
||||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36 Steps to reproduce the problem: Bug on Google Chrome https://jsfiddle.net/0b0jzssr/30/ 1. Use the input to choose a folder containing large file 2. Wait 10s 3. The memory should be freed but it's not What is the expected behavior? After 10s the memory should be freed It works as expected on FireFox and Chromium What went wrong? The memory stay allocated, you have to close the tab to free the memory Did this work before? N/A Does this work in other browsers? Yes Chrome version: 64.0.3282.186 Channel: stable OS Version: Mint 18.2 MATE 64-bit Flash Version: I noticed the bug on Google Chrome so I'm not sur this is the place to report, sorry if it's not
,
Mar 2 2018
Unable to reproduce this issue on reported version 64.0.3282.186 using Ubuntu 14.04 with steps mentioned below. 1. Opened https://jsfiddle.net/0b0jzssr/30/ , opened task manager and observed memory footprint of this tab. 2. Uploaded file and observed increase in memory usage. 3. After sometime memory of that tab becomes normal in task manager. @Reporter: Please check the video and let us know if we miss anything. Also please check the issue on fresh profile which do not have any apps/extensions. This info would help in further triaging of the issue. Thanks!
,
Mar 2 2018
sindhu.chelamcherla@ you need to choose a folder that contains large files (not in sub-folders) with a total size of 100-500MB for easier assessment. FWIW in Windows I can reproduce with old Chrome/Chromium (51-60). Bisected to r380607 (breakage) with a fix in 502c6ae6a03979efbd3e006e6a0b8c3369ca2bbc. However, I didn't test in Linux so this may be a different regression.
,
Mar 2 2018
I don't know why you can't reproduce, I think we are doing the same thing.
,
Mar 2 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Mar 2 2018
https://jsfiddle.net/0b0jzssr/38/ -> JSFiddle with comment Here is the expected comportement on Chromium
,
Mar 5 2018
As per comment #3, the issue seems to exist from M-60. Hence, marking it as untriaged for further inputs from dev team. Thanks...!!
,
Mar 5 2018
I'm not sure if this is WAI or not - the garbage collector doesn't necessarily remove stuff. We tell V8 about external blob memory I believe. See here: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp?dr=CSs&l=342 AdjustReportedMemoryUsageToV8 +mek
,
Mar 5 2018
*the garbage collector doesn't necessarily remove stuff right away* Does your system have a lot of memory?
,
Mar 5 2018
After a chat with mek@, it seems like the FileReaderLoader is holding a reference to the ArrayBuffer, but Oilpan has no way of accessing / accounting for that object. We don't count it as 'external' memory either. Not sure the best way to solve this, but I think we've confirmed this as an issue.
,
Mar 5 2018
possible ways of solving this: - make FileReaderLoader garbage collected (and change every place that owns one from std::unique_ptr to Member, and add tracing etc). - make FileReaderLoader DISALLOW_NEW, and change every place that owns one to just directly hold one rather than having a pointer. Only non-straightforward case I think would be IDBRequestLoader, where we'd then have to wrap the FileReaderLoader in something else. Every other usage I can find lifetime of the FileReaderLoader already seems to match lifetime of its owner. - Refactor FileReaderLoader to not actually hold on to any memory past the load operation. Instead just transfer ownership of the resulting data to the client in DidFinishLoading. - Probable other options exist as well...
,
Jun 15 2018
,
Jun 15 2018
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by susan.boorgula@chromium.org
, Feb 28 2018