
High CPU usage spikes and memory leaks in a freshly installed Firefox on macOS High Sierra
Every 10 minutes Firefox starts to use ~200-300% CPU and eats 1-2GB of memory in a span of a minute. After that everything becomes normal again. This is on a freshly installed Firefox Nightly 58.0a1 — profile folder removed from ~/Library/Application Support, no addons, not synced with the Mozilla account.
This happens even if nothing is opened in the browser. I've looked at `about:memory` details, and I've noticed that heap-unclassified is consuming most of the memory (up to 70%).
Interestingly, I already had this issue a week ago https://support.mozilla.org/en-US/questions/1180020 and I thought that reinstalling Firefox helped me, but this time it didn't. Last time I tried Firefox 57 beta as well, so I assume the bug is there as well.
Modified
Chosen solution
I think I might have figured it out.
What's happening: Some prefetching mechanism (?) tries to load a heavy page in the background (twitch.tv stream in my case) every 5-10 minutes, fully using CPU in the process for a good minute or two. Mind you, if you load the url directly, the content is loaded smoothly. Looking at the Gecko Profiler's traces it seems like Firefox tries to manipulate DOM every few ms in the span of those 2 minutes — could be stuck in some loop.
How to reproduce: This works even on a freshly installed Firefox — just add any twitch profile (https://go.twitch.tv/user_name) url to the Top Sites on a Dashboard. Restart Firefox and straight away you'll see high CPU usage in the background for quite a while. Every 5-10 minutes this will repeat again even if the browser is idle.
How to fix: Remove any Twitch streams from the Top Sites on the Dashboard. I am sure there are other sites that could trigger the same issue though.
Also, I've looked at how to disable prefetching (https://support.mozilla.org/en-US/kb/how-stop-firefox-making-automatic-connections), but it was already disabled.
Seems like a pretty nasty bug.
Edit: reproduced it on Windows machine as well
Read this answer in context 👍 0All Replies (11)
Have you gone through and seen if you have entries under show Memory Reports and there will be a list in 1 or 2 places that says Ghost Sites and shows Url's you have been to. If so close all tabs then hit refresh a bunch of times.
Or is it issues with about:support Multi-processor ?
Please let us know if this solved your issue or if need further assistance.
Couldn't find any Ghost Sites in the memory report. This issue can happen straight away after I open the browser, with no tabs opened at all.
about:support says Multiprocess Windows 1/1 (Enabled by default)
Note that support for OS X 10.13 if still in development and there is a lot that needs to be done.
- Bug 1379811 - [10.13] macOS "High Sierra" tracking bug
(please do not comment in bug reports
https://bugzilla.mozilla.org/page.cgi?id=etiquette.html)
cor-el said
Note that support for OS X 10.13 if still in development and there is a lot that needs to be done.(please do not comment in bug reports
- Bug 1379811 - [10.13] macOS "High Sierra" tracking bug
https://bugzilla.mozilla.org/page.cgi?id=etiquette.html)
I've looked at the reported bugs with High Sierra, but unfortunately there is nothing about my issue. Are there any Firefox debugging tools that would allow me to see what's happening in the thread when I get those CPU spikes? I guess I could use gdb, but surely there is a better way?
Please consider turning on send info to Mozilla before posting a question. This helps us help you. As I have no info from your system that would help see things that cause issues.
Like I would know this or know it was not installed and would not have to do this : Without even knowing it, you may have volunteered for this Mozilla experiment. Would you go to : Options => Privacy & Security => under 'Data Collection and Use' : Did you uncheck : 'Allow Firefox to install and run studies ' or is it checked ?
To check if you are enrolled in these studies :
Type in the address bar about:studies
Any extensions that you see listed there, you can either disable or remove, just like this Safe Browsing version 4 (at the end of the experiment they will be disabled anyway).
See for further information : https://support.mozilla.org/en-US/kb/shield
It has to do with Multiprocessor Support I would think. I guess you have a equivalent to Windows Task Manager. Open it and see how many instances (multi processor) you have running in and how much ram it is using. plus this will confirm : See if Multi-Processor Support is turned on. Multi-processor support feature may be disabled depending on your setup (it was for me) - you can check this by launching Firefox, then enter in "about:support" in the address bar; near the bottom, you should see a heading that says: "Multiprocess Windows", then look at the value next to it. If it says "0/1", then that means it's disabled. If says 0/2 or higher it is on and also should say it is enabled.
You can try to modify multi-process settings to see if this has effect. You can open the about:config page via the location/address bar. You can accept the warning and click "I accept the risk!" to continue.
set dom.ipc.processCount to 1 if it is currently set to a higher value (4)
disable multi-process windows in Firefox
You can disable multi-process windows in Firefox by setting these prefs to false on the about:config page.
browser.tabs.remote.autostart = false browser.tabs.remote.autostart.2 = false
http://kb.mozillazine.org/about:config Also can reverse everything this tells you to enable it. http://www.ghacks.net/2016/07/22/multi-process-firefox/
Please let us know if this solved your issue or if need further assistance.
Sorry, haven't noticed the share button at first, here is the data: https://pastebin.com/MiufDfDw
Multiprocess Windows is 1/1
I'll try disabling it and see if it solves the issue
taking a performance profile might also help in understanding the problem: https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Reporting_a_Performance_Problem
Chosen Solution
I think I might have figured it out.
What's happening: Some prefetching mechanism (?) tries to load a heavy page in the background (twitch.tv stream in my case) every 5-10 minutes, fully using CPU in the process for a good minute or two. Mind you, if you load the url directly, the content is loaded smoothly. Looking at the Gecko Profiler's traces it seems like Firefox tries to manipulate DOM every few ms in the span of those 2 minutes — could be stuck in some loop.
How to reproduce: This works even on a freshly installed Firefox — just add any twitch profile (https://go.twitch.tv/user_name) url to the Top Sites on a Dashboard. Restart Firefox and straight away you'll see high CPU usage in the background for quite a while. Every 5-10 minutes this will repeat again even if the browser is idle.
How to fix: Remove any Twitch streams from the Top Sites on the Dashboard. I am sure there are other sites that could trigger the same issue though.
Also, I've looked at how to disable prefetching (https://support.mozilla.org/en-US/kb/how-stop-firefox-making-automatic-connections), but it was already disabled.
Seems like a pretty nasty bug.
Edit: reproduced it on Windows machine as well
Modified
thanks a lot for sharing your findings - i can reproduce that as well and will file a bug for this!
philipp said
thanks a lot for sharing your findings - i can reproduce that as well and will file a bug for this!
Thanks!
Looks like this bug was already filed: https://bugzilla.mozilla.org/show_bug.cgi?id=1412505