How to stop Firefox on an SSD from freezing when using the search box or submitting a form?

4

3

Firefox usually freezes for about a second whenever I search for something from the toolbar search box, when submitting a form, or when clearing the search box history. I suspect it has something to do with the auto-complete feature. Using Windows 7's Resource Monitor, the problem seems to be from the file:

C:\Users\<username>\AppData\Roaming\Mozilla\Firefox\Profiles\<profile>\formhistory.sqlite-journal

I believe this is a temporary file which caches database writes. The following screenshot shows the very high response times from six different searches, and that the queue length on drive C shoots off the scale:

enter image description here

My Firefox profile is on an Intel X25-M G2 SSD. The problem doesn't seem to occur if I create a new profile on a hard disk drive. However, I'd like to know why the problem exists on the SSD in the first place (because it's an annoying problem which contradicts the reason I bought an SSD, and it might happen with other applications too), and how to prevent it. It still occurs if Firefox is started in safe mode, and with the recent beta versions.

Updates:

  • VACUUMing the Firefox profile databases does not help with this problem.
  • The SSD Optimizer in the Intel SSD Toolbox does not help either.

sblair

Posted 2009-12-13T00:26:48.517

Reputation: 12 231

I know it's been a while, but did you ever find any answer to this? (I'm curious in general -- not looking for specific remedy for this Firefox version) – Coldblackice – 2014-06-12T04:11:55.830

Answers

3

You might find a benefit from vacuuming the sqlite databases. This command should do it (on Linux):

cd ~/.mozilla/firefox/dasda418.default
for i in *.sqlite
do
echo 'vacuum;' | sqlite3 $i
done

where dasda418.default is your actual Firefox profile directory. Obviously you have to do this when Firefox isn't running. On Windows the command is:

for %i in (*.sqlite) do @echo VACUUM; | sqlite3 %i

This will compact the databases, making them smaller and might solve your problem.

gorilla

Posted 2009-12-13T00:26:48.517

Reputation: 2 204

Interesting suggestion, but this is on Windows, so I downloaded sqlite3.exe and put it in C:\Windows\System32. I then vacuumed places.sqlite (using "sqlite3 places.sqlite VACUUM;"), and the reindexed it, but the problem still exists. Is this the correct command for Windows? – sblair – 2009-12-13T01:05:53.053

Form entries are stored in formhistory.sqlite, so try that file. That's the right syntax, if you're pressing return after the sqlite3 command and before 'vacuum;' – gorilla – 2009-12-13T01:56:38.303

Via Firefox's Tools menu/Error Console, Components.classes["@mozilla.org/browser/nav-history-service;1"].getService(Components.interfaces.nsPIPlacesDatabase).DBConnection.executeSimpleSQL("VACUUM");

http://mozillalinks.org/wp/2009/08/vacuum-firefox-databases-for-better-performance-now-with-no-restart/

– outsideblasts – 2009-12-13T01:59:07.083

Sorry for terrible formatting. I'll put this as an answer for that purpose, but gorilla, you get the +1. – outsideblasts – 2009-12-13T02:00:17.597

Ahh, I got this to run on Windows for all the databases using: "for %i in (*.sqlite) do @echo VACUUM; | sqlite3 %i" (from http://www.gettingclever.com/2008/06/vacuum-your-firefox-3.html). However, the problem continues, so I believe it is to do with the way the database write cache (formhistory.sqlite-journal) is written to my SSD, and not to do with maintaining the databases.

– sblair – 2009-12-13T19:08:05.043

3

I agree with gorilla about vacuuming the database. A more direct method, independent of OS, is through Firefox's Error Console (Tools menu/Error Console)

In the Code text box paste this (it’s a single line):

Components.classes["@mozilla.org/browser/nav-history-service;1"].getService(Components.interfaces.nsPIPlacesDatabase).DBConnection.executeSimpleSQL("VACUUM");

Press Evaluate. All the UI will freeze for a few seconds while databases are VACUUMed

enter image description here

mozillalinks

outsideblasts

Posted 2009-12-13T00:26:48.517

Reputation: 6 297

This is a useful trick, but it has not affected my issue. Also, as the link points out, it only optimises the places database; as gorilla suggests, the other databases may need VACUUMing. – sblair – 2009-12-13T18:56:10.110

1

Have you tried to disable de disk cache? In Disk properties -> Hardware -> Properties -> Policies : uncheck the Enable write caching on the device You problem reminds me mine, and I think it's related to this box checked. I don't know why I must say as it's supposed to improve performance, even for a SSD disk. But since I've unchecked it, I am not experiencing slow downs in Thunderbird anymore. I wish it will do the same to you.

VVV

Posted 2009-12-13T00:26:48.517

Reputation: 11