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

Issue 658240 link

Starred by 2 users

Issue metadata

Status: Archived
Owner:
Last visit > 30 days ago
Closed: Aug 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Memory leak in battery status API

Reported by systempa...@gmail.com, Oct 21 2016

Issue description

Chrome Version 52.0.2743.116 (64-bit).
Also happens on Android (using cordova-plugin-crosswalk-webview version 1.7.0).

What steps will reproduce the problem?
(1) Create a page with a large chunk of javascript (e.g. a bundle created with browserify)
(2) Register a listener against the BatteryManager (from navigator.getBattery()), e.g. batteryManager.addEventListener('chargingchange', ...);
(3) Call window.location.reload()

What is the expected result?

The battery listener should be unregistered when the page unloads.


What happens instead?

The battery listener is not unregistered. The registered callback stays in scope, but it also keeps the entire javascript bundle in scope. Every time the page is refreshed, it loads another copy of the bundle into memory without releasing any of the old ones, leading to massive memory leak.

This is particularly bad for long-running applications such as Cordova apps.
 

Comment 1 by zhyp...@gmail.com, Dec 14 2016

This situation also happends on Windows Desktop and Ubuntu Linux

Comment 2 by sigbjo...@opera.com, Dec 14 2016

Labels: -Pri-3 Pri-2
Cc: kavvaru@chromium.org
Labels: Needs-Feedback
 systemparadox@Thanks for the issue.

Could you please provide us any test file or URL to triage the issue from test team end.

Thanks,
Please see attached test file. Refresh a few times and take some heap snapshots to see the memory usage keep going up. If you run with --enable-precise-memory-info you can see the memory usage on the page.

Thanks.
batteryleak.html
1.2 KB View Download
Cc: haraken@chromium.org mlippautz@chromium.org
Thanks for a fine bug report, I can't reproduce the leak with current releases.

I suspect this was addressed by  issue 650146 , which should be in M56 and later.
Project Member

Comment 6 by sheriffbot@chromium.org, Jan 10 2017

Labels: -Needs-Feedback Needs-Review
Owner: kavvaru@chromium.org
Thank you for providing more feedback. Adding requester "kavvaru@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 7 by cda...@chromium.org, Mar 13 2017

Labels: -Needs-Review
Cleaning up sheriffbot label "Needs-Review" label as a part of modified "Needs-Feedback" sheriffbot rule. [ref bug for cleanup 684919]
Status: Archived (was: Unconfirmed)
Confirmed. This appears to be fixed (Chrome 60.0.3112.101).

Thanks.

Sign in to add a comment