Firefox Slow and/or Causing High CPU Usage


One of the most likely cause of high CPU usage by Firefox is fragmentation of its database files (.sqlite files). If you have a habit of bookmarking and deleting unused bookmarks, places.sqlite, where bookmarks are stored, would be fragmented. You can shrink this file using sqlite3.

If you are using Windows OS, downlod this file from http://www.sqlite.org/download.html and extract the executable to C:\Windows folder (or any other folder included in the PATH variable).

If you are using Ubuntu, install sqlite3 using the following command
sudo apt-get install sqlite3

To shrink the database file, run the following command after replacing <your profile>  with your profile name

Windows:
sqlite3 "%APPDATA%\Mozilla\Firefox\Profiles\<your profile>\places.sqlite" "vacuum"

Ubuntu:
sqlite3 $HOME/.mozilla/firefox/<your profile>/places.sqlite "vacuum"

It is recommended that you take a backup of the sqlite file you are about to shrink.

If you wish to shrink all sqlite files, cd to the profile directory and run this command:

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

Ubuntu:
for i in *.sqlite; do echo "VACUUM;" | sqlite3 $i ; done

If shrinking the file doesn't solve the problem:
  1. Take a backup of places.sqlite
  2. Start Firefox and export all your bookmarks
  3. Stop Firefox
  4. Delete places.sqlite file
  5. Start Firefox and import your bookmarks

Comments

  1. The applications nowadays are more memory intensive as they are not constrained by the prices of memory. Get RAM for cheap at Amazon Corsair XMS3 8 GB

    ReplyDelete

Post a Comment

Popular posts from this blog

OS/DB Migration - CMD. STR, TOC, EXT, R3load, DDLDBS.TPL and more

Fixing Inconsistent Table - Table activation fails due to inconsistency between DD and DB

301 Redirect Using SAP Web Dispatcher