Discussion:
Why is FFox at 50% cpu when only one tab is open and it has a blank search page?
(too old to reply)
Micky
2016-04-27 13:28:47 UTC
Permalink
[Default] On Mon, 25 Apr 2016 16:05:22 -0500, in
mozilla.support.firefox (+)
alt.windows7.general (*)
microsoft.public.windows.vista.general
microsoft.public.windowsxp.general (*)
Actually, I didn't think this would work, because the mozilla group is
moderated. I was told about 15 years ago that if one posted to a
moderated and unmoderated group at the same time, the post wouldn't
reach the unmoderated one until it had passed moderation.

But what happened this time was that it never showed up in the mozilla
group and I had to post there separately. At least I was going to do
that, but maybe the answers I got here were enough that I thought the
mozilla folks couldn't do any better.
(*) Mickey does not declare the problem exists on Windows 7 or
Windows XP so his post there is off-topic. He only states
what happens on his Windows Vista setup. Different software
environs can produce different effects.
(+) Chris Ilias often rejects my posts in the Firefox newsgroup.
So my reply may only show up in the non-Mozilla newsgroups.
It did, but mostly, I think, for the same reason it didnt' show up for
me.

So I took Firefox out of the list just now.
Why is FFox at 50% cpu when only one tab is open and it has a blank
search page?
I'm using winVista but it's a lot like 7.
Firefox was slow, so I opened a new window with only one tab, and
closed the window with 20 tabs (most of them still not loaded after a
restart), and I still get Not Responding for Firefox.
I have almost no internet traffic (just some for my small webradio
player), barely any reading or writing to the disk, Sessionstore
completed being saved 7 minutes ago, I'm only using 81-84% of my RAM,
NO hard faults, but Firefox is using 50% of the CPU. And has been
for 9 minutes since I closed that FF windows.
And why does it stay at 49-50%? How come it doesn't go up higher to
do what it needs to do (since barely anything else is running), or
vary more than a percent.
When you load Firefox, you also load all the active extensions (add-ons)
that you installed into Firefox. Some of them perform updates. No, I
do not mean updates for the add-on code itself. I'm talking about
getting updates to data that the add-on uses. For example, the adblock
add-ons will need to check if there is a newer version of their block
lists.
Also, some add-ons will slow the load of Firefox. Add-ons store their
block lists into memory and why adding more subscribed block lists in an
adblocker results in consuming more memory. Takes time to read from the
slow hard disk those tables of block lists into memory.
Typically the add-on updates (to the add-ons themselves and for them to
get newer data) is short-lived. The longer time to load large block
lists and a larger number of them into memory occurs only when you load
Firefox; i.e., they affect load time for Firefox. Since this is not
what you describe but rather a constant high CPU usage, I would start by
loading Firefox in its safe mode, or disable all extensions and reload
Firefox. Then see if the firefox.exe process alone (without any child
threads for add-ons) is still sucking up the CPU.
When you "close" Firefox, has it actually unloaded? Load Task Manager
and watch its Processes tab. Load Firefox and, in Task Manager, select
to highlight the firefox.exe process. Then exit Firefox. How long
before the firefox.exe process disappears? Anything over 5 seconds is
too long for Firefox alone and hints that you have an add-on that
doesn't exit properly or does something on exit that takes a long time,
like it performs some cleanup actions that take time.
If you visit web pages with Flash content, and allow it, then Firefox
loads that plug-in inside its sandbox: plugin-container.exe. That
sandbox does occasionally hang on exiting Firefox. You may eventually
get a popup telling you that plugin-container.exe has crashed but not
always (it may simply hang instead of crash). You said that you were
loading Firefox with about:blank pages, not that you had visited sites
with Flash content. If you are visiting Flash-enabled web sites, look
in Task Manager to see if the plugin-container.exe process got loaded.
Then exit Firefox to see if plugin-container.exe hangs around although
the firefox.exe process disappeared. Sorry but I don't know of a way
(within Firefox) to force termination of its plugin sandbox on exit from
Firefox. I have yet to find an out-of-process add-on (the add-on, when
it loads because Firefox loaded, will start an out-of-process monitoring
program) that will monitor for an exit action from Firefox to then
ensure after some expiration interval that firefox.exe and
plugin-container.exe have truly unloaded.
Actually you said you had 1 tab open to a "blank search page". Whose
search? Have you tried configuring Firefox so your home page is
about:blank so you do load a blank page instead of running some script
at some search site? With extensions disabled (or using Firefox's safe
mode) and with the home page set to about:blank, use Task Manager to
ensure there are no lingering firefox.exe or plugin-container.exe
processes. Then load Firefox and exit it to see if firefox.exe is still
lingering around for more than a few seconds.
Start with loading just one tab to note CPU usage by firefox.exe. With
20 tabs open, cleanup could take awhile depending on what purge-on-exit
options you configured in Firefox and how big is its web cache. (I run
with a zero-sized web cache and haven't noticed any lag in connecting to
web sites and downloading and rendering their pages.)
Wow. Thanks a lot. I've read this once already, and I'll read it
again. It fills in some big holes, bigger than I thought they were,
in my understanding of all this.
Micky
2016-04-27 13:38:09 UTC
Permalink
[Default] On Mon, 25 Apr 2016 11:51:31 -0400, in
Why is FFox at 50% cpu when only one tab is open and it has a blank
search page?
What's going on??
I'm using winVista but it's a lot like 7.
Firefox was slow, so I opened a new window with only one tab, and
closed the window with 20 tabs (most of them still not loaded after a
restart), and I still get Not Responding for Firefox.
I have almost no internet traffic (just some for my small webradio
player), barely any reading or writing to the disk, Sessionstore
completed being saved 7 minutes ago, I'm only using 81-84% of my RAM,
NO hard faults, but Firefox is using 50% of the CPU. And has been
for 9 minutes since I closed that FF windows.
And why does it stay at 49-50%? How come it doesn't go up higher to
do what it needs to do (since barely anything else is running), or
vary more than a percent.
You forgot version number.
The latest version, 45.0.2.

I started another window so I could close the current window, that is,
ALL of the tabs but the one in the new window, but NOT close the whole
program, so I wouldn't have to wait for it to be done and wait for it
to start, and because I have often lost tabs, even when I closed FF on
purpose. Because the Sessionstore file was not updating when it was
supposed to. Once I notice it was running 13 hours late!!

However I waited and waited and the problem described above never
ended, so finally forced FF to close. I waited a bit, restarted it,
and it worked fine, with all the old tabs.

I've been using Session Manager and it makes a big difference. Though
be warned: I thought since hte purpose of the add-on was to make sure
all tabs were restarted, that this wold be the default, but it seems I
had to open the Options and set the interval for backing up
sessionstore, or nothing happened!! I think I set it at 7 minutes.
(It only backsup if changes have been made.)

Thanks for all that follows. Some of it is a bit of a slog for me,
hard to read, but I'll get through it.
Check developer tools, as there is a Profiler hiding in there.
https://hacks.mozilla.org/2015/06/new-performance-tools-in-firefox-developer-edition-40/
OK, here's an example of a screenshot from the one I was checking.
Loading Image...
The later versions of Firefox, use "compositing" at 60Hz, for
some sort of smooth video playback. Some sort of attempt
to make the web pages "more fluid". If your video card
doesn't have the hardware path for this feature,
a software fallback (using your CPU) can be used
instead.
The design assumption is, that the average user has a
one year old (powerful) video card, to make this stuff work.
But not all the desktops running this stuff, meet that description.
Instead, they end up using the CPU.
These are programming habits picked up from Smartphones.
Smartphones have powerful GPUs and weak CPUs, so it's natural
to shift the design to use more GPU.
I've also seen the heavy CPU usage problem, when running
modern Ubuntu in VPC2007 (an OS hosting software which
lacks video acceleration). As well as when LibreOffice
draws a graph in Calc (their version of Excel). They use
OpenGL, and on my computer, it was taking four minutes
to draw one puny little graph. So Firefox isn't the only program
taking steps in the wrong direction.
And the compositing function itself, isn't all that
demanding. My old Macintosh G4, with the ATI 9000 (gutless)
video card, could do window compositing, and handle window
priority (when one window overlaps another, the GPU
figures out the occlusion, only showing the portions
of windows you should be able to see). This allows the
user to move windows around the screen, with less impact
on the CPU cycles. But whatever Firefox is doing, is
likely to be a lot more complicated than that. I doubt
a 9000 (also available for PC platform), could contribute
any value to the Firefox compositing. It would be as
effective as a door-stop.
Since Mozilla has been interested in this stuff for a
long time, they must be doing something a bit more
complicated today, to need more resources. This
article is from September 2010. (Note - none
of the demos from the article run now.)
https://hacks.mozilla.org/2010/09/hardware-acceleration/
Operation Linux Windows XP Windows Vista/7 Mac OS X
--------- ----- ---------- --------------- --------
Content XRender None Direct2D Quartz
Compositing OpenGL Direct 3D Direct 3D OpenGL
HTH,
Paul
Mike Tomlinson
2016-04-28 10:57:51 UTC
Permalink
Post by Micky
[Default] On Mon, 25 Apr 2016 16:05:22 -0500, in
(+) Chris Ilias often rejects my posts in the Firefox newsgroup.
There's a surprise. Sensible chap.
--
(\_/)
(='.'=) Windows 10: less of an OS, more of a drive-by mugging.
(")_(") -- "Esme" on el Reg
Mark12547
2016-07-20 19:42:15 UTC
Permalink
mozilla.support.firefox (+)
alt.windows7.general (*)
microsoft.public.windows.vista.general
microsoft.public.windowsxp.general (*)
Some sites also reject post attempts that are cross-posted between the
Usenet Newsgroups and other (non-Usenet) newsgroups (like the mozilla.*
groups) because a reply in a Usenet newsgroup can't be propigated to an
organization's private newsgroup or vice versa.


Hogging the CPU:

One of the times I see Firefox hogging the CPU is when it is loading my
Netflix disc queue (which is very long) because a script runs on the PC
in Firefox that fetches my queue information and then fetches elements
(thumbnails, etc.) to display on the page. (It was much faster when
Netflix would build the page with the appropriate links and all Firefox
had to do was load the page and fetch the various elements.) Another
time is when it hits a pathological page that seems to have a very long
running script. I had also seen it with super-long web pages.

Loading...