Extension background pages might have Garbage Collection issues |
||
Issue description@tott Assigning to adamk@ since this *might* be v8 related, please re-assign back to me with possible fix hints or places to look at. It seems that extension background pages, which are never loaded in a tab, do not trigger GC like regular tabs do. I'm using the following sample extension [1] that uses chrome.browserAction.setIcon to use up lots of memory. On my linux machine, once I load/install the extension, looking at task manager, "Extension: Icon Example" memory usage goes up to ~53.8mb and stays there. I've tried keeping the extension as is for hours and didn't see the memory changing. However, as soon as I perform either of the following the memory goes down to ~36mb! 1) Open a tab pointing to a page in the extension, e.g. chrome-extension://extension-id/page.html 2) From chrome://extensions page, open devtools "background page". If that's not enough, call window.gc() explicitly from devtools (running chrome with "--js-flags=--expose-gc") This happened to "Automatic Room Finder" extension on my mac with my corp profile. The memory was over 120mb, and it went down to 80mb when I opened devtools of the extension. So the question is, is there some garbage collection hook missing for background pages? Because, if I perform similar amount of work on a tab on web urls [2], gc happens, at least as soon as I right-click on the page. [1] See attached zip file. https://github.com/lazyboy/chromium/tree/master/tests/extensions/set_icon_export [2] http://lazyboy.github.io/pages/image_leak/leak.html This page essentially mimics what browserAction.setIcon does, call new Image() and then draws png into the 2d canvas context of the element. The element is never put on DOM. Steps: Open task manager Click on "Test" button, do not interact with the page, probably by creating another new tab page and focusing to that. The memory generally settles at something over 100mb. It might go down in some cases, but if you repeat the steps, the memory will stay over 100mb or so. As soon as you click or right-click on the page, the memory will go down (40/50mb).
,
Jan 19 2017
This issue was fixed a long time ago. I thought I responded back then. Apparently I didn't. Closing now.
,
Jan 19 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by adamk@chromium.org
, Aug 4 2016Owner: hpayer@chromium.org