Firefox – Why does Firefox cause high-CPU-usage “spikes” every few seconds

cpu usagefirefoxfreezememoryperformance

When I start Firefox, I have no problems for a while, but after a couple of days, CPU spikes start to occur. During a spike, Firefox freezes and then stops. Spikes occur every seven to ten seconds, and each spike lasts for two to three seconds. If I am typing when a spike occurs, characters output only after the spike. I initially thought this problem was because of Flash, so I disabled it, but the problem still occurs.

Also, Firefox's memory usage increases to over 600 MB after several days.

The list of Firefox plugins and extensions I use is available here.

Best Answer

I suspect it is either the Garbage Collector or the Cycle Collector.

In about:config change javascript.options.mem.log to true. Now notices about GC and CC should be available in the Error console (Crtl+Shift+J) If their timing and duration matcher the freezing, then this is your problem.

When I had this problem I fixed it by blowing away my Firefox profile and creating a new one from scratch. The Firefox profiles have a tendency to gather a lot of crud over time.

Even this is not a prefect solution. If you open a lot of tabs in Firefox (100+) or lots of extensions and leave Firefox running for days on end it will inevitably slow down. You will need to restart Firefox every once in a while.

If you are like me and have a tendency gather a large collection of tabs you need get around to dealing with at some point another trick I use is to set browser.sessionstore.max_concurrent_tabs to 0. This will stop Firefox from loading all the tabs of your session when starting. It will instead load them when you switch to them. I find this, plus the occasional restart of Firefox, greatly reduces the load of having a great many tabs.

Related Question