Sometimes I just feel that Firefox is such a memory hog. Once I start to open up a few extra tabs, it starts to slow down my whole system. Fortunately, you can do something about it. Here are simple tips and tricks to reduce firefox memory and cache consumption.
Tip 1: Reduce session history
browser.sessionhistory.max_entries determines the maximum number of pages in the browser’s session history, i.e. the maximum number of URLs you can traverse purely through the Back/Forward buttons. The Default value is 50. We usually won’t surf more than 5 of the websites we previously surfed before, and there is really no need to store more than that in the session which can clog up memory as they grow.
1. Open Firefox
2. Type about:config in the Firefox address bar
3. Press CTRL-F and search for browser.sessionhistory.max_entries
4. Double click on the value 50 (or whatever value is there currently) and change it to something lower such as 5.
5. Restart Firefox.
For Firefox 1.5 and above, you can also look at another configuration variable browser. sessionhistory. max_total_viewers which also determines the maximum number of content viewers to cache for “bfcache” (fast back/forward navigation). Default value is -1 (calculate based on available memory).
Set it to 0 so that no pages will be stored in memory.
set it to a number such as 5 to store only 5 pages in memory.
more info here
Tip 2: Reduce memory usage when minimize
1. Start up Firefox
2. Type in about:config in the address bar and hit Enter
3. Right click and choose New > Boolean
4. Type config.trim_on_minimize in the pop-up box and hit Enter
5. Select True and hit Enter.
6. Restart Firefox
Tip 3: Fixed cache capacity OR Disable Cache Totally
Every time new page is loaded, Firefox will cache the page so it doesn’t need to load again to be redisplayed. By default, this setting is set to -1 for browser.cache.memory.capacity and to a number you specified in Tools -> Options -> Advanced -> Network / Cache for browser.cache.disk.capacity
To fix your cache to a certain value
:
Note: browser.cache.memory.enable and browser.cache.disk.enable needs to be True for this to work
1. Start up Firefox
2. Type about:config in the address bar and hit Enter
3. Search for browser.cache.memory.capacity and set a number in KB to use for the memory cache (ie. 1024KB = 1MB).
4. Search for browser.cache.disk.capacity and set a number in KB to use for the disk cache (ie. 1024KB = 1MB).
To Disable the cache Totally
Set both browser.cache.memory.capacity and browser.cache.disk.capacity to 0.
Alternatively, you can also set browser.cache.disk.enable and browser.cache.memory.enable to False.
Tip 4: Use less extension and themes
This is really a no brainer. Uninstall all firefox extensions and themes that you don’t use as they can cause Firefox to use more RAM. If you think that you might still need the extension in future but not using it currently, at least there’s an option to Disable it. Use only extensions that you usually use to cut down memory usage.
Always upgrade your extensions and themes to the latest version as they may fix the some problems leading to memory leaks. Firefox makes this quit easy as it now does the checking for you, all you need is to do is tick some checkboxes and your plugins and themes wil be updated.
Tip 5: Check Firefox Memory Usage
Type about:cache?device=memory in the address bar and hit Enter. Firefox will display your current number of entries, maximum storage size, storage in use and inactive storage.
There you have it. Happy browsing!
Klaw says
Or you could always use Firefox 3 Beta 5…
Abhishek Ravi says
Thanks a lot mate, that certainly helped me a great deal. I am a victim of firefox eating a huge part of my ram (probably because of the number of tabs open} but the above steps have certainly reduced ram usage by firefox a great deal.
mortenb says
All great, except I have a MP3 flash based player and I want to cache all my songs so they are not re-downloaded all the time. I usually set the cache to 2GBytes.
David says
If you’re good with firefox extensions, you can use “Firebug > NET panel” and tell where those MP3 are downloaded from. All you need to do is then copy the link location and save the file directly.
camnio says
grrr.. why does it take so much memory. thanks for the post
Kat says
Tip 2 has me a bit baffled. You wrote:
2. Type in about:config in the address bar and hit Enter
3. Right click and choose New > Boolean
Right click on what?
??
David says
Right click on any row under “Preference Name”
Kat says
Thanks David! 🙂
David says
Glad that it helped 🙂
civico says
This is excellent: comprehensive, well explained.
Thank you very much
darryl siemer says
Thanks much – did you write Firefox for dummies?
Simon says
hi i know this may sound stupid, but how much memory cache should i let firefox use?
i have 8gb of ddr 2 800 installed and right now i have that setting set to
disk.cache.memory.capacity integer 131072
David says
Not sure, Simon. I have a 8gb machine here too and i hardly find any need to do these tweaks anymore. These tweaks are useful for older or slower machine. Sounds like you’re having a fairly new computer there, is firefox still slow even with 8gb of ram?
Have you tried Chrome or Opera?
Simon Joshi says
i only ask because i use a ssd 😛
David says
what? a ssd is even faster, right? i’m only using a standard sata ide lol
Simon says
I ask because I use a solid state drive, and they recommend that firefox write cache to your ram instead of your hdd to not wear down the drive
David says
May I know where did you hear that (wearing down your ssd hd) from? All hard disk are meant to have stuffs read/write from/to it and SSD can handle that way better then normal sata ide hd.
Simon says
true, but ssd’s write data can wear down making the ssd slower than that of a standard HD, here’s the link (it’s pretty well known)
mydellmini.com/forum/windows-7/2441-windows-7-ultimate-solid-state-drive-speed-tweaks.html
Jeanne says
I did this and it definitely helped with memory usage, but I found I lost my home pages. Is that just collateral damage I have to accept, or is there a way to do this and still set a couple of tabs to open every time I use Firefox?
David says
Jeane, what do you mean by “set a couple of tabs to open every time I use Firefox”?
1. as in reopen the tabs from your last browsing session before you close firefox?
2. open a number of predefined tabs each time firefox starts?
jj says
with the about:cace?device=memory what should the numbers read if the settings are right. For instance, my “storage in use” reads 4194304 KiB. Seems like it’s still hogging.
Eric Cox says
WOW this site is annoying. It highlights your Google search terms, so when you got here by searching for a word that appears alot, it makes it impossible to read. Bleh!
David says
Point taken, the plugin doing the highlighting has now been disabled. Thanks for letting me know 🙂
heythere says
“Right click and choose New > Boolean”
Right Click WHAT????
helkav says
this is a good round up of the mish mash of tweaks to reduce FF usage – I am trying Aurora at the moment, so will see if it helps as it is hogging > 270mb of mem continuously, no matter how many tabs I have open it seems. a couple of points
– I would recommend trying sessionmanager add-in if people are like me and like to use FF to keep pages to go back to. pages can be stored in a diff. session and reloaded later that way
– browser.cache.disk.capacity in FF “manual” states it is for caching to hard disk – I think this is not relevant to memory saving?
http://kb.mozillazine.org/Browser.cache.disk.capacity
MirazMac.Info | Miraz Mac says
Thanks bro. At last i got rid of this memory hog 🙂
David says
No problem, glad it helped.
Anyway, I rarely use firefox these days and have chosen Google Chrome as my default browser. Maybe you can give Chrome a try?
Miko says
Or Firefox 47….!
Emmanuel says
I found that theses extensions reduce dramatically memory usage (test: opening 20 tabs in FF55 on a old 2Go computer):
– RamBack (Tools/Clear caches)
– uBlock Origin (to replace AdBlockPlus): https://en.wikipedia.org/wiki/UBlock_Origin#Performance
Akshat says
Did not make much if a difference to me.
hemiunu says
Even though this article is 10 years old, it still helped me to reduce my memory usage with the current version of FF. Thanks, David.
Vampy says
This is so old. First I typed in about:config then I typed in browser.cache.memory.capacity and that doesn’t bring up anything. It leaves a blank page. I did the first tip and it didn’t help at all. Why not fix FF so it doesn’t guzzle my RAM ????
David says
why not just switch browser from firefox to google chrome or opera browser?
Doe says
Google eats as much or more memory than Firefox. Pale moon is better tho.
Raul. says
Hi!
It is 2019, this tips F&%$# HELPED!!!
Thank You David!
Hasan Ibrahim says
A lot of information I get from here. Thanks a lot bro.
J Rich says
Not sure which item helped the most, probably the minimize one, but amazingly I went from using 4GB and seeing the memory continue to climb to seeing it slowly drop. At the moment its down to 1.8 GB and continues to drop. How has mozilla not enabled this by default?