Optimize Firefox’s memory usage by tweaking session preferences

In: General

10 Sep 2008

I’m a heavy tabbed browsing user – I have around 30 tabs open in my day-to-day Firefox profile all the time. Since the day Firefox 3 was released, I’ve noticed Firefox progressively getting slower with this particular Firefox profile (I use a different profile for web development). When it got to the point where changing tabs took a noticeable pause of 1-2 seconds, I tweaked some of Firefox’s session store and history preferences and now things are blazing fast again.

Here’s what you can do:

  1. Go to about:config in Firefox.
  2. Type in “session” in the “Filter” box.
  3. Edit browser.sessionhistory.max_entries – this is the number of pages stored in the history of your browsing session. Basically these are pages that can be reached using your Back and Forward buttons. The default is 50 – I reduced it to 20.
  4. Edit browser.sessionhistory.max_total_viewers – this is the number of pages that are stored in RAM so that they aren’t re-processed by Firefox’s rendering engine. This is what allows you to go Back to a page in Firefox and have it load almost instantaneously. The number of pages stored actually depends on the amount of RAM on your machine (see this). I reduced this to 4 (I have 2GB RAM).
  5. Edit browser.sessionstore.max_tabs_undo – the number of tabs you can restore after closing them (you can do this with Ctrl/Cmd-Shift-T). The default of 10 is more than I really need, so I reduced it to 3 tabs.
  6. Edit browser.sessionstore.interval – Firefox saves your session after every 10 seconds by default. I changed this to a more conservative 30000 milliseconds.

You can read more about these preferences and more at the MozillaZine Knowledge Base. If you’ve any tips on how to improve Firefox’s performance, be sure to share!

26 Responses to Optimize Firefox’s memory usage by tweaking session preferences

Avatar

whitemoon

September 10th, 2008 at 10pm

nice! i’ve changed my settings like yours already. =)

Avatar

Fred

September 11th, 2008 at 7pm

Great tips!

Thank!

you might also enable these to get faster network speed:

network.http.pipelining => true
network.http.pipelining.ssl => true
network.http.proxy.pipelining => true

:)

Avatar

Chu Yeow

September 11th, 2008 at 9pm

Hey Fred, thanks for sharing those. I’m already using them :)

Avatar

Todd Partridge

September 12th, 2008 at 5am

Good Tips!

I have a nearly ten year old computer and I was really disappointed when I upgraded from Firefox-3.0-beta5 to Firefox-3.01. The Mozilla Team must have boosted the memory allocation. About every minute I had large amounts of writing to the hard drive. I found out that this was Firefox saving the session to the hard drive. I adjusted the preference “browser.sessionstore.interval” to an absurbedly high (thank god Firefox is as stable as it is) 300000 and I got my browser back, thanks!

Avatar

Chu Yeow

September 12th, 2008 at 9am

Glad I could help Todd. I’m gonna increase my browser.sessionstore.interval even more now that you’ve had good results with it. Firefox is still taking up a lot of virtual memory on my Mac.

Avatar

tabrez

September 12th, 2008 at 9pm

Thanks for the tips.

Avatar

Dev Blog AF83 » Blog Archive » HTML5, Javascript, les User-Agent, l’élite des développeurs

September 16th, 2008 at 1am

Avatar

Jackson Pires

September 25th, 2008 at 7pm

Hi!

Please forgive my grammar and syntax because my english to write is not good yet.

I like only to iform you that I translate this post to portuguese, and I like to know if you allow this.

The post translated is

thanks!

Avatar

Chu Yeow

September 28th, 2008 at 11am

Hey Jackson, I’ve no problems with that at all, thanks for taking the time to translate it!

Avatar

mbah gendeng

October 7th, 2008 at 11am

yes i try n thanks for share

Avatar

Tweakare le preferenze della sessione di Firefox e risparmiare la memoria usata | Firefox Blog

November 14th, 2008 at 9pm

[...] Di Chu Yeow su Redemption in a blog [...]

Avatar

Lou K.

November 15th, 2008 at 12am

My problem isn’t so much RAM usage but CPU – I usually keep between 60-80 tabs open and somewhere in there are a bunch of javascript and flash scripts running continuously. It’d be nice if one could “put them to sleep”, as described here –

http://matthew.gray.org/2006/08/someone-write-this-firefox-plugin.html

and I added a bit more here, adding another potential solution –

http://tumblr.klepner.com/post/59565611/firefox-enhanced-tab-session-management

Avatar

Lenrius

November 27th, 2008 at 6am

@Lou K. Saw Ff xt #9429 here at LH: http://tinyurl.com/5vuhjl Was primed for picking a potential solution up after I had previously sought to find one in vain.

Subsequent citation should appeal to you: “… every tab you push to the TooManyTabs row frees up memory by turning the tabs you shelve into idle tabs”

Avatar

GRMTECH Blog » Blog Archive » Desktop configuration at Grmtech

November 30th, 2008 at 8am

[...] Application specific Config Firefox 1. Downloads go to dekstop/browser-downloads. This is configured using tools -> options -> main 2. Reducing the memory used by firefox. Follow the steps listed on: http://blog.codefront.net/2008/09/10/optimize-firefoxs-memory-usage-by-tweaking-session-preferences/ [...]

Avatar

santosh

December 4th, 2008 at 3pm

Great article thank you for sharing with us

Avatar

Nick

March 30th, 2009 at 3am

Many thanks man, searched a lot for this! You rule!

Avatar

Vietnam Portal

April 8th, 2009 at 12pm

Sweet, your article is really helpful. Thanks a lot!

Avatar

Sandro

June 21st, 2009 at 9pm

Lou K, just install the FF FlashBlock extension, and don’t load the Flash until you’re actually going to view it. That made FF infinitely more usable for me, as I generally have about 50 tabs open all the time. Flash is the killer; JS is generally ok I’ve found, once Flash was handled.

Avatar

How To Speed Up Firefox in 3 Simple Steps :: Winston{YW}

October 29th, 2009 at 11pm

[...] Optimize Firefox’s Memory Usage By Tweaking Session Preferences [...]

Avatar

CW

April 19th, 2010 at 2pm

You could also use the BarTab extension — it allows you to unload tabs at will and even start the browser with just one tab active and others grayed out until you actually click them.
https://addons.mozilla.org/addon/67651

Avatar

Fixing Firefox 3.6 « The Mighty Nice Blog

April 26th, 2010 at 5am

[...] for a fix led me to a post titled Optimize Firefox’s memory usage by tweaking session preferences. I followed the author’s suggestions point by point and then rebooted my box to get a clean [...]

Avatar

Mahe

June 11th, 2010 at 10pm

Excellent article.. thanks.

Avatar

Siti Web a Bari - Roberto Antonacci

September 4th, 2010 at 6pm

Great stuff buddy, thanks for having saved my macbook from meltdown :D

Avatar

Optimize Firefox’s memory usage by tweaking session preferences – redemption in a blog « Data Warehouse in the Cloud

September 16th, 2010 at 1pm

[...] 16, 2010 browser.sessionstore.interval via blog.codefront.net Posted by dmoraschi Filed in Uncategorized Leave a Comment [...]

Avatar

optimize firefox memory usage | StuffThatSpins.com

October 14th, 2010 at 12am

Avatar

HostGaul

May 27th, 2012 at 6am

Great job. thanks for that, also firefox have an extension for this named Speedfox and you can easily install it.

Here’s the link

https://addons.mozilla.org/en-US/firefox/addon/speedfox/?src=api

Comment Form