Closed Bug 516227 Opened 15 years ago Closed 15 years ago

firefox eats up lots of cpu

Categories

(Firefox :: General, defect)

3.0 Branch
All
Linux
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 508427

People

(Reporter: david, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.14) Gecko/2009090217 Ubuntu/9.04 (jaunty) Firefox/3.0.14
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.14) Gecko/2009090217 Ubuntu/9.04 (jaunty) Firefox/3.0.14

especially with lots of windows and tabs firefox tends to go into a loop that eats up a full cpu

a strace of the offending thread looks like this

ead(3, 0x1eeee24, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=14, events=POLLIN|POLLPRI}, {fd=18, events=POLLIN|POLLPRI}, {fd=20, events=POLLIN|POLLPRI}, {fd=22, events=POLLIN|POLLPRI}, {fd=11, events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}, {fd=49, events=POLLIN}, {fd=122, events=POLLIN}, {fd=24, events=POLLIN}], 11, 0) = 1 ([{fd=24, revents=POLLIN}])
read(24, "\372"..., 1)                  = 1
read(3, 0x1eeee24, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=14, events=POLLIN|POLLPRI}, {fd=18, events=POLLIN|POLLPRI}, {fd=20, events=POLLIN|POLLPRI}, {fd=22, events=POLLIN|POLLPRI}, {fd=11, events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}, {fd=49, events=POLLIN}, {fd=122, events=POLLIN}, {fd=24, events=POLLIN}], 11, 0) = 0 (Timeout)
write(30, "\372"..., 1)                 = 1
read(3, 0x1eeee24, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=14, events=POLLIN|POLLPRI}, {fd=18, events=POLLIN|POLLPRI}, {fd=20, events=POLLIN|POLLPRI}, {fd=22, events=POLLIN|POLLPRI}, {fd=11, events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}, {fd=49, events=POLLIN}, {fd=122, events=POLLIN}, {fd=24, events=POLLIN}], 11, 0) = 1 ([{fd=24, revents=POLLIN}])
read(24, "\372"..., 1)                  = 1
read(3, 0x1eeee24, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=14, events=POLLIN|POLLPRI}, {fd=18, events=POLLIN|POLLPRI}, {fd=20, events=POLLIN|POLLPRI}, {fd=22, events=POLLIN|POLLPRI}, {fd=11, events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}, {fd=49, events=POLLIN}, {fd=122, events=POLLIN}, {fd=24, events=POLLIN}], 11, 0) = 0 (Timeout)
read(3, 0x1eeee24, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=14, events=POLLIN|POLLPRI}, {fd=18, events=POLLIN|POLLPRI}, {fd=20, events=POLLIN|POLLPRI}, {fd=22, events=POLLIN|POLLPRI}, {fd=11, events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}, {fd=49, events=POLLIN}, {fd=122, events=POLLIN}, {fd=24, events=POLLIN}], 11, 0) = 0 (Timeout)


Reproducible: Sometimes

Steps to Reproduce:
it tends to happen more frequently the more tabs and windows are in use. open a lot of windows and tabs, exit saving which ones are open then start firefox
Actual Results:  
in the window where firefox was started I have two errors

nsHeaderInfo: registerSelf called!
nsHeaderInfo: registerSelf called!


if I strace the thread that is eating all the cpu firefox seems to be in a loop of polling and getting -EAGAIN. at the moement (with 3.5.4) it is eating about 50% of a cpu, but I have seen it peg a cpu completely (nothing betwen the read and poll)

if I do this on a single cpu system it effectivly locks up the system. on a SMP box the system can limp along loosing the capability of the one cpu
I have seen this problem on both x86 and amd_64 It has been happening since at least firefox 3
To rule out extension bugs and corruptions in the profile, can you retest in safe-mode and with a new profile?
http://support.mozilla.com/en-US/kb/Safe+Mode
http://support.mozilla.com/en-US/kb/Basic+Troubleshooting#Make_a_new_profile
Version: unspecified → 3.0 Branch
I first duplicated the problem with --safe-mode

I then renamed .mozilla to .mozilla.old restarted firefox (in safe mode) to have it create a new .mozilla directory. I then stopped firefox, copied sessionstore.js to the new .mozilla directory and restarted firefox (in safe mode) again. it I had the same problem
Please update to 3.5.3 or later as performance has been improved in that version. also, were you on website such as streaming video, etc.?
Severity: critical → major
I have the same problem with 3.5.3

in fact while trying to login for this reply I had to shut down firefox and restart as it got into a tight loop that made it unuseable 
sched_yield()                           = 0
read(3, 0x7febd35a9074, 4096)           = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=14, events=POLLIN|POLLPRI}, {fd=18, events=POLLIN|POLLPRI}, {fd=22, events=POLLIN|POLLPRI}, {fd=23, events=POLLIN|POLLPRI}, {fd=11, events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}, {fd=63, events=POLLIN}], 9, 0) = 0 (Timeout)
sched_yield()                           = 0
read(3, 0x7febd35a9074, 4096)           = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=14, events=POLLIN|POLLPRI}, {fd=18, events=POLLIN|POLLPRI}, {fd=22, events=POLLIN|POLLPRI}, {fd=23, events=POLLIN|POLLPRI}, {fd=11, events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}, {fd=63, events=POLLIN}], 9, 0) = 0 (Timeout)
sched_yield()                           = 0
read(3, 0x7febd35a9074, 4096)           = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=14, events=POLLIN|POLLPRI}, {fd=18, events=POLLIN|POLLPRI}, {fd=22, events=POLLIN|POLLPRI}, {fd=23, events=POLLIN|POLLPRI}, {fd=11, events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}, {fd=63, events=POLLIN}], 9, 0) = 0 (Timeout)
sched_yield()                           = 0
read(3, 0x7febd35a9074, 4096)           = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=14, events=POLLIN|POLLPRI}, {fd=18, events=POLLIN|POLLPRI}, {fd=22, events=POLLIN|POLLPRI}, {fd=23, events=POLLIN|POLLPRI}, {fd=11, events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}, {fd=63, events=POLLIN}], 9, 0) = 0 (Timeout)


some of the sitesin the tabs probably do have video, but in safe mode flash should be blocked and in normal mode I use flashblock so they don't sit and run all the time. at most I have a couple of flash items running at any one time and the cpu load does not seem to be related to that (if I don't start any flash items I still have the problem)
even after all windows had closed it could not exit

at that point in time strace said
Actually, flash is not blocked in safe mode :). Only addons. This could be something beside flash, quickitime, silverlight, etc. Although you are on linux.
it does look very similar to that bug. if he is seeing that with 20-30 tabs, I have a LOT more so the problem looks more significant to me.

lsof shows filehandle 3 as

firefox-3 10237      dlang    3u     unix 0xffff88006b06db80             8141569 socket

(I can send my sessionstore.js to someone, but I don't want to post it here)

by the way, what is firefox doing trying to use sched_yield()? that call can be a noop in many cases.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.