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.
,
Dec 14 2016
,
Dec 29 2016
systemparadox@Thanks for the issue. Could you please provide us any test file or URL to triage the issue from test team end. Thanks,
,
Jan 3 2017
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.
,
Jan 3 2017
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.
,
Jan 10 2017
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
,
Mar 13 2017
Cleaning up sheriffbot label "Needs-Review" label as a part of modified "Needs-Feedback" sheriffbot rule. [ref bug for cleanup 684919]
,
Aug 22 2017
,
Aug 24 2017
Confirmed. This appears to be fixed (Chrome 60.0.3112.101). Thanks. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by zhyp...@gmail.com
, Dec 14 2016