Red Hat Bugzilla – Bug 923416
Firefox consumes too much CPU
Last modified: 2013-10-09 04:34:29 EDT
Description of problem:
Freshly started Firefox with empty start page consumes 8% CPU according to top.
While loading Bugzilla and entering this bug the CPU usave was between 10 and 25% as far as I could see.
I'm not sure, but that was probably the cause of my Lenovo X220 battery being drained very quickly two days ago. (Normal desktop usage can survive up to 4-5 hrs, it didn't last even 2 hrs the other day).
I didn't have any such issues with previous versions of Firefox.
Version-Release number of selected component (if applicable):
Do you have ny special extension installed? Can you try to run FF in safe mode? ($firefox -safe-mode). And can you reproduce it with upstream binary from mozilla.org?
I have several non standard extensions but I doubt they are the cause b/c I had the same with previous versions as well.
Running in safe mode isn't that much different. When FF loads the CPU usage spikes at around 10%. If I wait it settles down to 1% or less.
While loading this page it spikes back to 16% then settles down once the page is fully loaded. If I scroll down to the bottom of the page after it's been loaded CPU usage spikes back to 20% for a short time.
While typing this comment the average CPU usage is 4-5%.
If the scrolling causes the load it's caused by your graphics driver. I can reproduce it with VESA X drivers. Generally any overdraw of the page causes the power peek.
Which X driver do you run? It may be caused some unsupported graphics operation which has to be emulated by CPU.
Looking at this again I see Xorg right next to Firefox in top output.
I don't know how to reliably tell which Xorg driver I am using. NOTE: I don't have xorg.conf file, it's auto configured. I googled some commands and here's what comes out:
$ lspci -nnk | grep -i vga -A3
00:02.0 VGA compatible controller : Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller [8086:0126] (rev 09)
Subsystem: Lenovo Device [17aa:21da]
Kernel driver in use: i915
Kernel modules: i915
$ grep LoadModule /var/log/Xorg.0.log
[ 57.434] (II) LoadModule: "glx"
[ 57.444] (II) LoadModule: "intel"
[ 57.445] (II) LoadModule: "vesa"
[ 57.445] (II) LoadModule: "modesetting"
[ 57.445] (II) LoadModule: "fbdev"
[ 57.467] (II) LoadModule: "fbdevhw"
[ 57.679] (II) LoadModule: "fb"
[ 57.689] (II) LoadModule: "dri2"
[ 57.860] (II) LoadModule: "evdev"
$ egrep -i " connected|card detect|primary dev" /var/log/Xorg.0.log | grep II
[ 57.678] (II) intel(0): Output LVDS1 connected
I guess it's the intel driver. If you want me to execute another command just let me know which one.
Yes, it's the intel driver...assigning to Xorg.
How is this the intel driver? The only way the intel driver uses CPU is if a client application asked it to do something. If you don't want it to use CPU, stop telling it to draw things.
I have intel video cards on all my company laptops and I can't reproduce the issue. I guess it somehow specific to the hardware - missing HW acceleration or so (scrolling can use OpenGL textures in FF).
Anyway, Alexander, you can turn off the OpenGL acceleration (Pereferences -> Advanced -> General -> turn off hw acceleration - see http://lifehacker.com/disable-firefoxs-hardware-acceleration-to-fix-slowness-749344037).
I now have firefox-17.0.9-1.el6_4.x86_64 and with HW acceleration turned off it looks to be better although I still can see Firefox spikes up to 14% CPU consumption from time to time.