Solved: Firefox Freezes Every 10 Seconds, Scrolling is Jumpy
Problem
Firefox (3.6.13) intermittently freezes. This happens during scrolling, text input, basically everywhere in the user interface, rendering the browser nearly useless.
Analysis
While browsing amazon.de I created a log of Firefox’s activities by recording system activity for 85 seconds with Sysinternals Process Monitor. I then filtered the log to include only Firefox activities. Clicking on Tools -> Process Activity Summary I got:
Every 10 seconds, a lot of file I/O occurs. Let’s examine that closer:
Tools -> File Summary:
Wow, Firefox writes a whopping 415 MB to sessionstore-2.js during our 85 second analysis period. With the help of our process activity summary graph we can determine that it does so in bursts which occur approximately every 10 seconds and last 1-2 seconds.
Googling for “sessionstore-2.js” yields a promising first result: The mozilla support document Firefox hangs which recommends deleting all instances of sessionstore*.js if there is more than one. There was. I deleted sessionstore.bak, sessionstore.js and sessionstore-1.js, each roughly 25 MB in size, and restarted Firefox.
The immediate effect: Firefox forgot the tabs opened in the last session. I guess that is what is stored in sessionstore.js then. But why 25 MB for a simple list of tabs? Taking a closer look at sessionstore.js we see this:
Obviously Javascript code, but why so much of if? It seems Firefox keeps a record of every URL opened since it was started, but also of form input and cookies. In order to be able to restore the previous session after a crash it writes this session information every 10 seconds to disk, replacing sessionstore.js with bigger and bigger versions each time a new URL is opened. This goes on until sessionstore.js becomes so big that the process of recreating it every 10 seconds freezes the user interface for a short time.
Workarounds
Until the developers fix this problem, there are two ways to get around these periodical freezes of the browser UI:
- Delete sessionstore*.js every time the freezes reappear, as I did. The easiest way to navigate to the profile folder containing sessionstore.js is by clicking on Help -> Troubleshooting Information -> Open Containing Folder.
- Disable the session store altogether. This does not disable the history, just the ability to restore the previous session after a restart of the browser. To do so, open
about:config
and setbrowser.sessionstore.max_tabs_undo
andbrowser.sessionstore.max_windows_undo
to 0.
7 Comments
Hey, thanks really… this problem was killing me, Firefox can become crazy some times. I wasn’t even able to write a stupid email without firefox eat one of my cores and stay there stuck for some momentd. Now with your fix firefox is running grate. This problem should be addressed for mozilla. But thanks again!
I’ve done this, but my Firefox still freezes every ten seconds or so when I’ve had it open for a while. Process timeline screenshot: http://i1097.photobucket.com/albums/g359/dpmm99/Firefail.png
It looks like Firefox accesses the registry ridiculously frequently: (this is part of my registry access summary from the same time period as that screenshot)
“0.0038892”,”506″,”167″,”167″,”0″,”0″,”172″,”HKCU”
“0.0028589”,”501″,”167″,”167″,”0″,”167″,”0″,”HKCU\Control Panel\International\Geo”
“0.0016814”,”167″,”0″,”0″,”167″,”0″,”0″,”HKCU\Control Panel\International\Geo\Nation”
“0.0004774”,”48″,”16″,”16″,”0″,”16″,”0″,”HKLM\Software\Wow6432Node\Microsoft\IdentityCRL”
And it still uses a silly number of IO operations to play with some of its files: (part of the ProcMon “File Summary”)
“0.0214703”,”228″,”48″,”24″,”0″,”108″,”0″,”0″,”48″,”[user]\AppData\Roaming\Mozilla\Firefox\Profiles\cksagzzs.default\permissions.sqlite-journal”
“0.0020714”,”216″,”0″,”0″,”12″,”24″,”0″,”0″,”180″,”[user]\AppData\Roaming\Mozilla\Firefox\Profiles\cksagzzs.default\permissions.sqlite”
“0.0015890”,”133″,”0″,”0″,”38″,”95″,”0″,”0″,”0″,”[user]\AppData\Roaming\Mozilla\Firefox\Profiles\cksagzzs.default\cookies.sqlite-wal”
“0.0006297”,”102″,”0″,”0″,”0″,”0″,”0″,”0″,”102″,”[user]\AppData\Roaming\Mozilla\Firefox\Profiles\cksagzzs.default\cookies.sqlite-shm”
“0.0233486”,”53″,”14″,”10″,”0″,”16″,”0″,”0″,”13″,”[user]\AppData\Roaming\Mozilla\Firefox\Profiles\cksagzzs.default\sessionstore-1.js”
“0.0007473”,”47″,”0″,”0″,”0″,”38″,”0″,”0″,”9″,”[user]\AppData\Roaming\Mozilla\Firefox\Profiles\cksagzzs.default\cookies.sqlite”
“0.0003625”,”42″,”16″,”12″,”0″,”0″,”4″,”0″,”10″,”[user]\AppData\Roaming\Mozilla\Firefox\Profiles\cksagzzs.default”
The stack summary suggested my extreme lag fest may be due to a Skype extension, but I can’t test this quickly since Firefox behaves for the first while when I open it.
I had a similar problem which I tracked to the Evernote extension using this technique described (thanks!). It writes a large amount of data every few minutes causing firefox to freeze up momentarily. I disabled the extension and the problem went away.
I was having this same problem with the new release of Firefox 18. I disabled all the add-ons/extenstions and my mouse was still jumpy. Although the setting names are different in this version compared to what was mentioned in the article above, I disabled all of the “browser.sessionstore” settings and now my jumpy-ness is gone.
Thanks for the info. I have downloaded Sysinternals suite from microsoft website. But I don’t see any tool related to what you did. Can you add a bit more info?
An easier way around this is to just change the browser.sessionstore.interval in about:config
just change it to an hour or whatever and then u wont notice the hang
Thak You… Long time AFTER your publication and IT´s work fine.. THANKS