New issue
Advanced search Search tips

Issue 596605 link

Starred by 7 users

Issue metadata

Status: Duplicate
Merged: issue 242215
Owner: ----
Closed: Apr 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Memory leak in chrome.browserAction.setIcon().

Reported by smbl...@gmail.com, Mar 21 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36

Steps to reproduce the problem:
1. Use chrome.browserAction.setIcon() on an extension's background page (with a tabId specified) for every new tab.
2. Create some tabs, remove some tabs, create some tabs, remove some tabs, and so on
3. 

What is the expected behavior?
The memory consumed by the extension remains roughly constant.

What went wrong?
The memory consumed by the extension rises quite rapidly.  In the case of Vimium, on the order of 200KB per tab.

WebStore page: https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb/reviews?hl=en

Did this work before? Yes It worked in 48.0.2564.109.

Chrome version: 50.0.2661.37  Channel: n/a
OS Version: Debian (Jessie)
Flash Version: Shockwave Flash 20.0 r0

Try the attached mini-extension to demonstrate the issue.
 
setIcon-issue-demo-extension-smblott.tgz
12.0 KB Download

Comment 1 by smbl...@gmail.com, Mar 24 2016

Update... I'm seeing this issue in 49.0.2623.87 (stable) too.

Also, it appears that the issue is caused by repeatedly setting the icon.  It does not have to be a tabId-specific icon.

Comment 2 by rob@robwu.nl, Apr 28 2016

Labels: -OS-Linux OS-All
Mergedinto: 242215
Status: Duplicate (was: Unconfirmed)
Reproduced, debugged and reduced. This bug has the same root cause as issue 242215 (getImageData is used here: https://chromium.googlesource.com/chromium/src/+/master/extensions/renderer/resources/set_icon.js).

The work-around is to use chrome.browserAction.setIcon with ImageData [1]. So duplicate the loadImagePath logic from set_icon.js, cache the ImageData variable somewhere in your code and call chrome.browserAction.setIcon({imageData: the_image_data_that_you_just_cached});

[1] https://developer.chrome.com/extensions/browserAction#method-setIcon

Sign in to add a comment