Preventing Firefox memory, processor bloat

If you’ve read this blog before, you know I’m a big Firefox fan. But the one problem that has dogged me is the inevitable bloat that Firefox suffers when open for long periods of time. I work in my browser all day, and after 8 hours it has usually gobbled up all the available RAM, and sucks processor cycles like a Dyson. Fortunately I’ve finally pinpointed the cause and several solutions. Let’s start at the source. The Firefox team made a crucial usability decision, which is at the heart of the problem. They wanted to allow the user to recover any page that may have recently opened. So by default, Firefox keeps navigation history for all your open tabs, plus the last 10 tabs that you closed. The navigation history for each of those tabs — both open and closed — can hold up to a maximum of 50 pages (i.e. the number of URLs you can traverse purely through the Back/Forward buttons) With no limit to the number of open tabs, plus the high limit on the Back/Forward navigation, it’s easy to see why Firefox slows to a crawl. If you do a lot of browsing in a lot of tabs, your memory disappears in a hurry. Managing all that extra memory causes the processor to work overtime to keep Firefox hippo moving. There are two ways to fix this issue in a pinch. First you can simply restart the browser, making sure that it doesn’t save your tabs (you are prompted to save tabs at close by default). Second, you can clear the Recently Closed Tabs to eliminate a portion of the tab history bloat (History > Recently Closed Tabs > Clear Closed Tabs List). For a more long-term solution, we need to mess with the system settings. Type about:config in the address bar to bring up Firefox’s complete configurations list. The latest Firefox versions present you with a warning before opening the page. A warning: this page handles everything in your browser. Everything. Don’t mess with stuff if you don’t know what you’re doing. In the “Filter” textbox at the top, enter browser.sessionstore.max_tabs_undo This setting controls how many closed tabs to track. Less old tabs = less memory usage. Double click the lone entry in the list and change the value from “10” to “5.” Back to the filter box, enter browser.sessionhistory.max_entries This setting controls the navigation history limit. Double click the entry and drop the value from “50” down to “25”. Close the about:config tab and restart your browser. Your mileage on these tweaks will vary depending on your system specs. If you can go a day of heavy browsing without hitting the creep, slowly increment the settings back up, until you hit the sweet spot.