Hovering some hyperlinks causes 100% CPU usage, memory leaks and UI hangs after landing patch from bug #1356317

VERIFIED FIXED in Firefox 56

Status

()

Core
Graphics: Layers
--
blocker
VERIFIED FIXED
11 months ago
9 months ago

People

(Reporter: Virtual, Assigned: spohl)

Tracking

(9 keywords)

56 Branch
mozilla56
x86_64
Windows 7
dogfood, hang, memory-footprint, memory-leak, nightly-community, perf, regression, reproducible, topperf
Points:
---

Firefox Tracking Flags

(firefox-esr52 unaffected, firefox54 unaffected, firefox55 unaffected, firefox56+ verified)

Details

Attachments

(2 attachments, 1 obsolete attachment)

[Tracking Requested - why for this release]:

STR:
1. Open this website page - https://bugzilla.mozilla.org/show_bug.cgi?id=1357486#c41
2. Scroll down to " Treeherder Bug Filer" comment
3. Hover bug 1379721 (or do it here)
and enjoy 100% CPU usage, memory leak eating nearly all memory and GUI hang
FYI - Also set to "Off" "Use modal user interface" preference in Bugzilla General Preferences ( https://bugzilla.mozilla.org/userprefs.cgi?tab=settings )
Keywords: footprint, mlk
Summary: Mozilla Firefox Nightly 56.0a1 (2017-07-10) (64-bit) using 100% CPU, leaks memory and hangs on some links hovering → Disabled modal Bugzilla user interface causes Firefox to use 100% CPU, memory leak and hang on some links hovering
status-firefox54: ? → unaffected
status-firefox55: ? → unaffected
status-firefox-esr52: ? → unaffected

Comment 3

11 months ago
Regression window:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=41b421e98b77575451f5769f89af788fe68f183b&tochange=d1181db727669d3f0902c9ace520c377f67ae46a

Regressed by: Bug 1356317
Blocks: 1356317
Flags: needinfo?(spohl.mozilla.bugs)
Keywords: regressionwindow-wanted

Updated

11 months ago
Component: Untriaged → Graphics: Layers
Product: Firefox → Core

Comment 4

11 months ago
Created attachment 8885267 [details]
reduced html
Thank you Alice0775 White very much for finding specific regression range!
Has Regression Range: --- → yes
Has STR: --- → yes
(Assignee)

Comment 6

11 months ago
I'm able to reproduce and I'm looking into it.
Assignee: nobody → spohl.mozilla.bugs
Status: NEW → ASSIGNED
Flags: needinfo?(spohl.mozilla.bugs)
Summary: Disabled modal Bugzilla user interface causes Firefox to use 100% CPU, memory leak and hang on some links hovering → Hovering some hyperlinks causes 100% CPU usage, memory leaks and UI hangs after landing patch from bug #1356317
(Assignee)

Comment 7

11 months ago
Kris, could you take a look at this as well? I've observed a continuous increase in memory consumption when displaying the tooltip when hovering links, but the memory consumption reverts to its initial state once the mouse is moved and the tooltip disappears. At this point, I don't believe we're dealing with a memory "leak", but rather some kind of unnecessary, continuous memory allocation. Unfortunately, I've been unable to isolate where or why this is occurring so far.
Flags: needinfo?(kmaglione+bmo)
(Assignee)

Comment 8

11 months ago
At the risk of possibly stating the obvious, a tooltip (which is displayed when hovering a link) is a popup and gIsPopupCompositingEnabled is set to false, which is why previous to attachment 8881870 [details] [diff] [review] landing, we would not use OMTC.
(Assignee)

Comment 9

11 months ago
Created attachment 8885792 [details] [diff] [review]
Patch

This basically restores attachment 8881870 [details] [diff] [review], but changes nsWindow::ShouldUseOffMainThreadCompositing() to enable OMTC for remote content. This fixes the issue reported in this bug. However, I'm not sure if this change is satisfactory because I don't know if we're also experiencing excessive memory consumption with OOP WebExtension popups.
Attachment #8885792 - Flags: feedback?(kmaglione+bmo)
Tracking 56+ for this regression.
tracking-firefox56: ? → +
I think we should probably just disable OMTC for "small" popups, which would include things like tooltips and menus:

http://searchfox.org/mozilla-central/rev/31311070d9860b24fe4a7a36976c14b328c16208/widget/nsBaseWidget.cpp#882
Flags: needinfo?(kmaglione+bmo)
(Assignee)

Comment 12

11 months ago
Created attachment 8885851 [details] [diff] [review]
Patch

As suggested. I've confirmed that this fixes the memory consumption issue for me locally.
Attachment #8885792 - Attachment is obsolete: true
Attachment #8885792 - Flags: feedback?(kmaglione+bmo)
Attachment #8885851 - Flags: review?(kmaglione+bmo)
Attachment #8885851 - Flags: review?(kmaglione+bmo) → review+

Comment 14

11 months ago
On Windows tool tips in bugzilla currently aren't displaying. Possibly a dupe of this bug?

Comment 15

11 months ago
(In reply to Jim Mathies [:jimm] from comment #14)
> On Windows tool tips in bugzilla currently aren't displaying. Possibly a
> dupe of this bug?

never mind, appears this is caused by level 3 sandboxing.
(Assignee)

Comment 16

11 months ago
I'm setting this to checkin-needed to get a second pair of eyes on it before landing. The try run seemed to show a lot of failures, but I was unable to determine if those were all just known intermittents, or if this patch would introduce new failures. For comparison, here is a try run with this patch applied:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=3710fb78cf3deca4828ffd3d21af4f5e81d03fc2

And here is a try run with a patch that should just behave as nightly does right now:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=166dda3e730dd66bc1cd53042ba1ad56fc32812c

Rather than just introduce some whitespace for the second patch, I wanted to run a try run with a patch that touches the same files as the first patch. This was to make sure that we rebuild the same files and run the same tests. I've noticed before that a no-op patch with just some added whitespace does not necessarily trigger the same tests to run. It appears to me that both try runs show almost exactly the same failures, which leads me to believe that these are known intermittents. Is this correct?
Keywords: checkin-needed

Comment 17

11 months ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c623242b62da
Fix high memory consumption when hovering links on Windows. r=kmag
Keywords: checkin-needed

Comment 18

11 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/c623242b62da
Status: ASSIGNED → RESOLVED
Last Resolved: 11 months ago
status-firefox56: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
I'm confirming that this issue is fixed, starting since Mozilla Firefox Nightly 56.0a1 (2017-07-15).
Thank you very much! \o/
Status: RESOLVED → VERIFIED
status-firefox56: fixed → verified
You need to log in before you can comment on or make changes to this bug.