Closed Bug 1830037 Opened 2 years ago Closed 2 years ago

GC overhead resulting 100% CPU usage and ending up freezes/hangs after each 30-60sec and occasionally panics on macOS

Categories

(Core :: Performance: General, defect)

Firefox 112
defect

Tracking

()

RESOLVED INCOMPLETE
Performance Impact pending-needinfo

People

(Reporter: furkan.turkal, Unassigned)

Details

Attachments

(7 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/112.0

Steps to reproduce:

Firefox was working like a charm on my MacBook Pro '16 19 with Venture 13.0 macOS, without any issues. But somehow, after I did upgrade to Venture 13.2.1, Firefox started random hangs/freezes after each 30-60sec. And it takes ~5-10sec. I started to get random panics 2-3 per day.

I did not changed anything in the settings. This also happens in Private Window mode. I usually restart the computer everyday. (Eventually a new Firefox instance each new day, before Ventura 13.0 and still do after upgrade)

I have read the followings:

https://support.mozilla.org/en-US/kb/diagnose-firefox-issues-using-troubleshoot-mode
https://support.mozilla.org/en-US/kb/refresh-firefox-reset-add-ons-and-settings 

But didn't help me to resolve the root cause.

I was checking out the "about:processes" page. The freeze happens when Firefox CPU exceed 100%. (During that time-window, my computer's CPU usage in between 10%-20%). I'm not sure what to problem is. But seems like garbage collector issue. I can see only the first item (which is Firefox) uses the CPU on limits (> 95%). Other processes does not even use a CPU! (Maybe max 3-5%.)

I have refreshed the Firefox (by keeping my tabs and history) and also renamed content-prefs.sqlite to content-prefs.sqlite.old and same problem started occurring again after one week.

mach_msg2_trap shows 93% sample rate.

My Environment:

Firefox 110.0
macOS 13.2.1 

Actual results:

  • Very slow browsing experience
  • Uses >95% CPU on idle (Firefox Process)
  • Frequent freezes/hangs after each 30-60sec
  • Occasionally panics

Expected results:

I expect no CPU usage at idle. I should understand the reason of "why" CPU usage is high and "who" actually consumes it.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Cocoa' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Cocoa
Product: Firefox → Core

Uploading a saved memory report from about:memory from when you are experiencing the problem might help understand why the gc/cc is taking so long.

Attached file memory-report.json.gz

Uploaded memory-report.json.gz file as requested.

Markus, do you have any thoughts here?

Severity: -- → S3
Flags: needinfo?(mstange.moz)
Priority: -- → P3

The long GC times in the parent process hint at a memory leak in the Firefox UI. Can you check whether any of your add-ons might be part of the triggering circumstances?

Component: Widget: Cocoa → Performance
Flags: needinfo?(mstange.moz) → needinfo?(furkan.turkal)
Attached video FirefoxHangs.mp4

A video that demonstrates Firefox is hanging after a few hours of usage.

Flags: needinfo?(furkan.turkal)

Sorry for the second comment; there is no edit button on the previous comment.

I attached a video that demonstrates Firefox is hanging after a few hours of usage:

  • Unable to open a new tab
  • Unable to close a tab
  • Unable to jump any websites (even about: pages)
  • Unable to open TaskManager

CPU usage is on limit, >3Gi MEM is available.

The long GC times in the parent process hint at a memory leak in the Firefox UI. Can you check whether any of your add-ons might be part of the triggering circumstances?

I check the extensions from TaskManager and during GC::collect step (when CPU exceeds >95%), extensions still shows 0% CPU usage with 5Gi of memory. How can I do further analyze?

You can disable all your extensions and wait for the problem to re-occur. If it doesn't, you can bisect until you find the add-on which causes it.

You can also try to see where the memory usage in the parent process is, on about:memory.

This bug was moved into the Performance component.

:furkan.turkal, could you make sure the following information is on this bug?

  • For slowness or high CPU usage, capture a profile with http://profiler.firefox.com/, upload it and share the link here.
  • ✅ For memory usage issues, capture a memory dump from about:memory and attach it to this bug.
  • Troubleshooting information: Go to about:support, click "Copy raw data to clipboard", paste it into a file, save it, and attach the file here.

If the requested information is already in the bug, please confirm it is recent.

Thank you.

Flags: needinfo?(furkan.turkal)

The component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit BugBot documentation.

Priority: P3 → --

Here is the video of Firefox UI is entirely broken after a while. I've disabled all the plugins but only 3 of enabled: Vimium, Symantec, uBlock, Refined GitHub

Attached file Raw Data

Including the Profiler URL. During the 30s of profiling, Firefox hanged almost 3 times.

Flags: needinfo?(furkan.turkal)

Included the profiling and raw data as requested. And also a video about UI unresponsiveness.

Flags: needinfo?(fdoty)
Flags: needinfo?(fdoty) → needinfo?(mstange.moz)

Oh, looking at the video, this doesn't seem like a performance issue - the UI is just broken! I'm not sure what might be going on there. Do you see any errors on the browser console?

It's also worth checking if add-ons are involved in this, though I'd hope that add-ons wouldn't be able to cause this kind of breakage.

Component: Performance → General
Flags: needinfo?(mstange.moz)

this doesn't seem like a performance issue

Actually I don't agree for this. It's not just about frozen-UI. Firefox is extremely slow and always hangs with over 100% CPU peaks. I also tried by disabling the plugins and issue still persists. I have to kill the main process almost every hour.

Did you able to check the performance profiler logs?

Flags: needinfo?(mstange.moz)

(In reply to furkan.turkal from comment #13)

I've disabled all the plugins but only 3 of enabled: Vimium, Symantec, uBlock, Refined GitHub

All of these appear to listen for tab updates, possibly with the exception of Vimium. Do you have a lot of tabs open?

The GCs in the parent process are running under this convert function from ext-tabs-base.js, which is only used when add-ons are installed which observe the tab bar. So it would still be interesting to know if the performance problems go away if these add-ons are disabled.

Flags: needinfo?(mstange.moz)

Moving to the Performance component to get more insights about what happened here.

Component: General → Performance

As requested by Markus we need to know whether this issue still occurs when -all add-ons- are disabled.

Please let us know if you still see the issue when not using any add-ons.

Flags: needinfo?(furkan.turkal)
Performance Impact: --- → pending-needinfo

A needinfo is requested from the reporter, however, the reporter is inactive on Bugzilla. Given that the bug is still UNCONFIRMED, closing the bug as incomplete.

For more information, please visit BugBot documentation.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Flags: needinfo?(furkan.turkal)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: