Growing memory from opening images in DOM and removing them
Reported by
alecper...@gmail.com,
Jan 24 2018
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36 Steps to reproduce the problem: Steps to reproduce the problem: Follow up to issue 625168 : https://bugs.chromium.org/p/chromium/issues/detail?id=625168 It was once reported ( Issue 625168 ) that Chrome holds on to displayed images in memory even after the image has been removed from the DOM. Following pseudo code APPARENTLY demonstrated the problem for (let i = 0; i < 100000; ++i) { let e = document.createElement('img') e.src = 'file:///tmp/1161kb.png' document.body.appendChild(e) setTimeout(() => { document.body.removeChild(e) }, 1000) } Did this work before? N/A What is the expected behavior? Once an image is taken out of the DOM, its resources are freed. What went wrong? APPARENTLY Memory would grows until you get an out of memory crash. Did this work before? N/A Chrome version: 64.0.3282.119 Channel: stable OS Version: 10.0 Flash Version: See: https://i.imgur.com/P3ZwlCS.gifv Chromium apps like VS Code currently refuse to allow preview of images/files >1mb (without allowing user to configure this limit) They reference issue 625168 , so I made this one since I like to preview large files in VS Code. I was able to loop ~10000 times before it crashed, which may just have been due to scrolling the console. I've got good pc specs: https://i.imgur.com/ghtNjgT.png but even with mediocre cpu/ram very rarely would this cause a crash if ever, probably.
,
Jan 25 2018
alecperkey@ Thanks for the issue. Tested this issue on Windows 10 and Mac OS 10.12.6 on the latest Stable 64.0.3282.119 and Canary 66.0.3330.0 by following the below steps. 1. Launched Chrome and navigated to Devtools -> Console. 2. Pasted the given code in console and executed it. 3. Opened Task Manager and monitored it. 4. Once the code got executed , could see the message on Console '100000 Not allowed to load local resource:file:///tmp/1161kb.png' and cannot see any crash on Chrome. Attached is the screen shot for reference. Can you please check and confirm if anything is missed from our end in reproducing the issue. Also attached is the system information on which the issue was checked. Request you to kindly retry the issue on a new chrome profile and if there are any crashes, please update the thread with the Crash ID from chrome://crashes, which will help in further triaging of this issue. Thanks..
,
Jan 25 2018
For windows you must find the Chrome.exe Mine was in "C:\Program Files (x86)\Google\Chrome\Application" But it could be in APPDATA iirc Then you right click, create shortcut, and add to the shortcut tab: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Default" --allow-file-access-from-files The --allow-file-access-from-files is the important part since local files should usually not be accessible by Javascript programs (Security hole). the --profile-directory="Default" is unnecessary for you, but I have multiple profiles so multiple chrome shortcuts depending on which Google Acc I'm using. https://i.imgur.com/DlZcwDZ.png as for iOS, try this search: "--allow-file-access-from-files" +ios +chrome 2 crash reports yesterday: https://bugs.chromium.org/p/chromium/issues/detail?id=806099 https://bugs.chromium.org/p/chromium/issues/detail?id=806100
,
Jan 25 2018
also you need to actually have the file located at the referenced place in the script: https://i.imgur.com/6ZsZvhm.png
,
Jan 25 2018
Thank you for providing more feedback. Adding requester "susanjunia.boorgula@techmahindra.com" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jan 29 2018
alecperkey@ Thanks for the feedback. Tested this issue again on Windows 10 on the latest Stable 64.0.3282.119 and Canary 66.0.3334.0 and unable to reproduce the issue by following the below steps. 1. Launched Chrome with the flag --allow-file-access-from-files. 2. Navigated to Devtools -> Console, pasted the given code in console and executed it. 3. Monitored the task manager and could not observe any spike in memory usage. Didn't observe any crash on chrome as well and could see the message on Console '100000 Not allowed to load local resource:file:///tmp/1161kb.png'. As per comment #3, as 2 crash issues are raised for this issue, requesting someone from Inhouse team to please look into this issue and help in further triaging. Thanks..
,
Feb 6 2018
The snippet implies that for a second all these images are kept in memory. You are not using http, so connection is not throttled, so you could end up loading image 1000 times.
,
Oct 15
This is blocking https://github.com/Microsoft/vscode/issues/42122 |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by manoranj...@chromium.org
, Jan 25 2018