New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 634439 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

Extension background pages might have Garbage Collection issues

Project Member Reported by lazyboy@chromium.org, Aug 4 2016

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).

 
set_icon_export.zip
2.3 KB Download

Comment 1 by adamk@chromium.org, Aug 4 2016

Cc: adamk@chromium.org
Owner: hpayer@chromium.org
Assigning to hpayer@ for GC/Blink interaction expertise.

Comment 2 by hpayer@chromium.org, Jan 19 2017

This issue was fixed a long time ago. I thought I responded back then. Apparently I didn't. Closing now.

Comment 3 by hpayer@chromium.org, Jan 19 2017

Status: Fixed (was: Assigned)

Sign in to add a comment