Firefox performance - frequent stalls

I have 13.2/KDE 4.14.6 running with Firefox 38.0.1

I tend to be a bit ‘sloppy’ with my browser these days, keeping 10-12 tabs open to speed bouncing about on various topics.
Over the past couple months I have experienced, with increasing regularity, periods in which Firefox appears to have stalled or frozen.
I usually have KSystemMonitor open, and during these stalls see Firefox consuming 25% or more (likely a full core, of 4) doing what it is doing.

i’ll add that ever since Mozilla switched to Yahoo as the default Search (but I still use Google, so this is a version marker) , I see al lot more unblockable Pup-Ups and nuisance adv activity. If I had to, I would somewhat correlate this issue with the version that made the Yahoo switch, but I don’t recall the release #.

I keep Firefox up to date, from the openSUSE-13.2-Update repo

Anyone else experiencing this?
In an attempt to investigate, I moved several almost always open tabs over to Chrome.
That helped a little, Chrome does not seem to have the same issues. I have tried selectively closing some of the Firefox tabs, but the stalls continue.

Any thoughts on how to better diagnose?

Thanks in advance.

On 2015-06-03 19:16, cmcgrath5035 wrote:
>
> I have 13.2/KDE 4.14.6 running with Firefox 38.0.1
>
> I tend to be a bit ‘sloppy’ with my browser these days, keeping 10-12
> tabs open to speed bouncing about on various topics.
> Over the past couple months I have experienced, with increasing
> regularity, periods in which Firefox appears to have stalled or frozen.
> I usually have KSystemMonitor open, and during these stalls see Firefox
> consuming 25% or more (likely a full core, of 4) doing what it is doing.
>
> i’ll add that ever since Mozilla switched to Yahoo as the default Search
> (but I still use Google, so this is a version marker) , I see al lot
> more unblockable Pup-Ups and nuisance adv activity. If I had to, I would
> somewhat correlate this issue with the version that made the Yahoo
> switch, but I don’t recall the release #.

I have two addons on firefox: Flashblock (version 1.5.18 currently) you
should have: it blocks ALL flash animations till you click on an arrow
the addon displays on placeholders. Flash is a very likely candidate at
high cpu load.

The second one is “addblock plus”, currently version 2.6.9.1-signed,
which can be used to block the worst commercial (or all). The available
filters are listed here https://easylist.adblockplus.org/en/

I don’t block all commercials, only those that are intrusive. And I make
exceptions on some org pages, I understand they need to make a living. I
block popups or floating banners and such.

Notice however that addblock adds memory ussage. Possibly a lot,
depending on the pages. It also slows down page loading, because it
breaks parellelization: pages elements have to be fully downloaded and
examined before each element in them is allowed to load and display, or
blocked.

Some info on this:

https://blog.mozilla.org/nnethercote/2014/05/14/adblock-pluss-effect-on-firefoxs-memory-usage/

https://adblockplus.org/blog/on-the-adblock-plus-memory-consumption

http://www.reddit.com/r/programming/comments/25j41u/adblock_pluss_effect_on_firefoxs_memory_usage/

page with 400 iFrames, With ABP, needs 1960MiB
http://vimcolorschemetest.googlecode.com/svn/html/index-c.html

One very interesting post:
++++—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-
Chrome Dev here. We see this (and much more) with chrome as well.

Adblock, noscript, ghostery, and other addons like them cause 90% of the
issues we see in the forums.

At the very least, by running any of these you are:

Increasing memory usage anywhere from 10% to 30%
increasing overall cpu usage across all cores
increasing overall load time of the page by about 15% to 50%
completely screwing many of the optimizations that have gone into
the browser, effectively making the multi-threaded nature of the browser
fight itself.

This is because these programs need to interrupt any and all http calls
to check them against a big list of “no-no” domains held in memory. If
it matches, they remove the element from the dom so it doesn’t load and
let the browser continue.

This has the effect of making every single thread sync up each time the
dom is updated, so these extensions can scan the new elements to ensure
they aren’t loading ads/scripts. Fancy stuff like threaded compositing,
network predictors and prefetchers, and batched layout rendering are all
abandoned when any one of these is in play.
—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—-+±

>
> I keep Firefox up to date, from the openSUSE-13.2-Update repo
>
> Anyone else experiencing this?
> In an attempt to investigate, I moved several almost always open tabs
> over to Chrome.
> That helped a little, Chrome does not seem to have the same issues. I
> have tried selectively closing some of the Firefox tabs, but the stalls
> continue.
>
> Any thoughts on how to better diagnose?

Try about:healthreport, about:buildconfig, about:memory… what it
doesn’t have is a CPU load one, specifically one that shows the load on
each tab (Chrome does have a CPU display page - try Shift + Esc).

I also miss a view or lists of all open tabs.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Thanks Carlos - long list!

I’ll start with Flashblock -

completely agree with robin_listas
just wanted to share some experience about a relatively new (for firefox) ad blocker
uBlock Origin
https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/
it’s supposed to be a lot faster then adblockplus
according to their tests (on Chromium) browsing uses less memory then without an ad blocker
https://github.com/gorhill/uBlock#performance

ps the mozilla people have been doing a lot of changes regarding mp4 rendering, the latest versions use html5 instead of flash on youtube and pages with embedded youtube video’s
as bad as flash is on Linux, there seam to be some bugs regarding html5 and mp4 that are even more complex on Linux as Firefox uses the OS’s build-in decoders, maybe when (if) Firefox bundles ffmpeg (as chrome did) we’ll get a better media experience
this prefference does exist media.fragmented-mp4.ffmpeg.enabled

just a quick note
I am writing this from a win box and I can’t test it but according to this
https://oneanddone.mozilla.org/en-US/tasks/89/
If you want to test on Linux: ffmpeg is enabled by default at compile time on Linux but disabled by prefs.
if you have ffmppeg from packman you can try this
in about:config
media.fragmented-mp4.exposed=true
media.fragmented-mp4.ffmpeg.enabled=true
media.mediasource.mp4.enabled=true

not sure what Firefox uses as the current back-end, but imo ffmpeg is the best media library and should do a good job rendering mp4’s

Firefox performance-vise I thought I’d share this info
I really wouldn’t trust google (Chrome) devs talking about noscript or adblockers as 90% of their revenue is from ads. Yes adblockplus increases RAM and CPU usage significantly but noscript reduces RAM and CPU usage.
I’d like to share these ublock graphs that seam rather interesting:
RAM
http://i.imgur.com/SMocL1F.png
CPU (notice the significantly lower cpu usage) of ublock vs adblockplus
http://i.imgur.com/ArPCFmI.png

ps there seams to be a fork of ublock by a new developer, I’m talking about the original author that seams to have lost his projects name and has a new one aka ublock origin.

ps
http://vimcolorschemetest.googlecode.com/svn/html/index-c.html with ublock origin
uses only 580MiB of RAM on a 32bit system with 4 GiB

Thanks for info, lots to digest.

I did install Flashblock 1.5.18.1 add-in, Firefox now idling nicely at 6-8%CPU.

ps if you’d like to remove that new yahoo search button and go back to the drop-down menu do this:
in the address bar type about:config
find the preference
browser.search.showOneOffButtons and set it to false
now you’ll have the pre yahoo search box.

On 2015-06-03 23:36, cmcgrath5035 wrote:
>
> Thanks for info, lots to digest.
>
> I did install Flashblock 1.5.18.1 add-in, Firefox now idling nicely at
> 6-8%CPU.

Good! :slight_smile:


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

I_A - Thanks, I immediately changed back to Google as default search when the change originally appeared, so I am good.

After a few days of use I conclude that Flashblock is helping but is not a real solution to my issue.

I tried an alternate test - opened Firefox on my laptop with the same TAB combination that stalls frequently on my desktop.
Laptop is an Intel Quadi7 running integrated intel graphics driver.

On the laptop, the %cpu consumed by Firefox is lower, 3-4% when ‘idle’ vs 7-8% on desktop, cpu increases when interacting with Firefox, with spikes into the high teens but does not exhibit the ‘stalls’ I experience on desktop. The laptop performance specs are better than the desktop, but not by a huge difference.

The above, combined with other observations that on desktop, Chrome does not exhibit the stalling either, leads be to believe that the root cause may be Firefox interfacing with the fglrx driver,. I’ll continue search down that path for a while.

it could be a bad profile
maybe even a bad live bookmark
try with a fresh profile
http://kb.mozillazine.org/Profile_Manager#Linux
https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles

just don’t forget to backup your bookmarks and or add-ons
https://support.mozilla.org/en-US/kb/export-firefox-bookmarks-to-backup-or-transfer

are you maybe using sync, as good as a feature that is it could be doing a lot of background things especially if you have multiple devices connected to the same profile.

On 2015-06-09 15:26, cmcgrath5035 wrote:
> The above, combined with other observations that on desktop, Chrome does
> not exhibit the stalling either, leads be to believe that the root cause
> may be Firefox interfacing with the fglrx driver,. I’ll continue search
> down that path for a while.

Or the addons. I mentioned that “addblock plus” and similar tools can
cause delays.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Carlos - Thanks, I did not turn on adblock yet, understand it’s potential for delay.

Along the line of thinking of I_A, and from some forum searching, I decided to try with a clean new user.
That gives me a new .kde, a new .kde4 and a bare naked Firefox (no add-ons).

As step 1, I have started up the same 7 Firefox Tabs that were showing issues on my ‘legacy’ login.

So far, mixed results, Firefox seems a bit more responsive, but opening any Tab or URL that has a flash video reports Flash has crashed, so I’m not sure it is a good comparison yet.

Still working at it

That gives me a new .kde, a new .kde4 and a bare naked Firefox (no add-ons).

not sure why is kde effected?
there are a few ways to clean your profile but none of them has anything to do with kde, firefox is a gtk+2 app and doesn’t have any kde dependencies, kde does replace some of the gtk widgets with qt elements but that doesn’t effect performance.
If your issues are on specific sites it could be flash related, the npapi flash version has been abandoned by Adobe it could be that some flash elements are looking for something that isn’t there, the Firefox version of Flash is 11 while the Chrome is up to 17. If this is an issues with flash you could try using pepper-flash with the freshplayerplugin (search for them in yast).
With the last few releases mozilla has forced the html5 player on youtube video’s and sites that use embedded tube video’s, I have noticed a lot of extra processing because of that, personaly I’m forcing flash on youtube, I’m thinking this might be your problem.
I have a lot less powerful machine and no issues with the fox and I have 30+ addons installed.
you could post the url’s of the problematic sites.

On 2015-06-09 20:36, I A wrote:
>
>> That gives me a new .kde, a new .kde4 and a bare naked Firefox (no
>> add-ons).
> not sure why is kde effected?
> there are a few ways to clean your profile but none of them has anything
> to do with kde, firefox is a gtk+2 app and doesn’t have any kde
> dependencies, kde does replace some of the gtk widgets with qt elements
> but that doesn’t effect performance.

He created a new user. All configs are new, default.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

If we’re playing a guessing game and assuming that there is nothing wrong with his system, my thoughts about the increased cpu usage is mozilla’s decision to replace flash video decoding with html5 native one, happened to me on sites with a lot of embedded youtube video’s, the flash tags got replaced with html5 apps that’s why I asked about what pages does that happen.
ps I use pepper-flash with the freshplayerplugin, I’m not sure how I installed it but been using it a few months now without any real issues.
Also a lot of sites do use timed (with counters) advertising (a new add every 90 seconds etc) that’s where an adblocker can decrease cpu usage, atm I’m using ublock origin and I am satisfied.

edit
an interesting read about freshplayerplugin and it’s pro’s for replacing the old adobe flash with google’s (still adobe’s) pepper flash, a simple flash switch might fix things.
http://www.webupd8.org/2015/04/fresh-player-plugin-024-released-with.html

I_A, Carlos is aware that I am also having STR (sleep) issues with this system, and I am beginning to wonder if issues might be related.
An interesting observation I have is that attempts to toggle Desktop Effects off (Alt-Shift-F12) causes Kwin to crash, which has me wondering if my .kde and .kde4 directories are now out of sync with reality (a side effect of zupper dup upgrades and my lazy decision to keep old .kde* so I don’t have to resetup my desktop)

I_A’s comments on flash might also explain why Chrome behaves well but Firefox not-so-much on a certain set of Tabs, none of which by themselves seem more problematic than an other. So starting a new user test account was my approach to creating a new Firefox profile.

There are getting to be too many moving parts here.
I am going to focus on getting kde/kwin running more sanely(and toggling Desktop Effects) and see where I am.

You can try renaming .kde and .kde4 (noe it will take you back to the default desktop configs) and see if things improve or try another user. It the problems follow it is a config problem for your user. To rename you must do so out side of your user. ie best to boot to a terminal and log in as root to remove. Removing files while being used can cause problems :open_mouth:

Status Update
I saw enough improvement experimenting with a new user login that I decided to do this:

  1. Drop to alt+ctl+F1 terminal
  2. Login as root
  3. execute init3 to kill X
  4. Navigate to /home/username
  5. Renamed .kde and .kde4 to block them but keep around for reference
  6. Reboot

It took a bit of effort to reset my widgets and wallpapers and the like,
but so far will say this has cleared my Firefox stall issues.

Too early to say how this affects my STR (sleep) issues.

Sidebar comments

  1. I conclude that rolling the .kde and .kde4 folders forward between releases is a really bad idea, I am going to stop doing it.
  2. By happenstance, I stumbled upon two in-frequently used web sites that are broken interfacing to Firefox, work OK in Chrome.
    The folks at Mozilla need to clean up their act a bit. Both were payment web interfaces, caused a security complaint in one case, a blank tab in another.