detect memory leaks from scrolling |
|||||
Issue descriptionIssue 701025 revealed a long-standing bug in cc::AnimationPlayer which leaked a few bytes in the renderer after every mouse-wheel scroll. The scroll "jumping" behavior requires scroll anchoring + specific conditions, but the memory leak does not - it's every scroll on every webpage on Windows/Linux/CrOS. (Mac and Android were unaffected as they don't have impl-side scroll animations). Do we have bots that should have detected this? Is there some sort of test we can write that would verify that scrolling doesn't leak memory?
,
Mar 21 2017
,
Mar 21 2017
After bisecting I found the regression was introduced by http://crrev.com/417132 (not quite as old as I thought). JS scrollTo won't repro this, it requires input events hitting the compositor.
,
Mar 21 2017
skobes: Thanks for bisecting. This wasn't visible at all by system health benchmarks. We get run-to-run noise of ~200KB, so a couple of bytes isn't going to be visible.
,
Mar 21 2017
Scroll simulation in Telemetry is done through https://cs.chromium.org/chromium/src/content/renderer/gpu/gpu_benchmarking_extension.cc?rcl=a0a9840a39b61caca179486dcf20927fe99ad4a6&l=684 I am not sure whether this is realistic enough to reproduce Issue 701025 though. +Erik: maybe we can make a stressed scroll test in trivial page to see if it can detect the issue?
,
Mar 21 2017
Assuming we leak 16 bytes per scroll, we'd need 6000 scrolls to get a 100KB leak. I don't know how cc handles scrolls [e.g. do we need separate scroll?]. Maybe this is worth doing, but the test would take a while to run. This seems like a potentially good case for extending the cc MemoryDumpProvider. What is the object that is leaking in this case?
,
Mar 21 2017
> What is the object that is leaking in this case? AnimationPlayer::animations_ is a std::vector<std::unique_ptr<Animation>>. Each scroll added a cc::Animation object to the vector, and they never got removed when they finished.
,
Mar 22 2017
Would it be possible to write a pathological page that catches this leak? How long would we have to run the page to generate a sizable leak? (100kB)
,
Mar 22 2017
Maybe this is silly but on the metric side, I wonder whether we can track objects count as a another memory related metric? That may help with detecting leaking of objects of small size, I think
,
Mar 22 2017
The objects are 120 bytes and the leak is rate limited by the animation time (~150 ms). So pathologically we could leak up to 800 bytes per second or 100 KB in just over 2 minutes.
,
Sep 21 2017
If this is still valid, we should find an owner.
,
Nov 7
This regression has been open for half a year. It's not very actionable and the regression has been in all Chrome user's hands for months.
,
Nov 9
Just to clarify: I fixed the regression before I filed this bug. The fix is r457443. This bug was to see if we could improve our testing. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by primiano@chromium.org
, Mar 21 2017