How to fix the Firefox memory leak (Firefox hack)
Firefox memory leak? It doesn’t have one. Unfortunately, because of the way it’s configured to run out of the box it *looks* like it has one.
Follow these simple steps to get your Firefox memory usage under control.
These configuration changes are a trade-off between internet browsing speed and memory usage. They are most useful if you are multitasking and need Firefox to be less of a memory hog while using other applications.
#1: about:config
Type “about:config” into your address bar to access the hidden configuration options for Firefox.
#2: browser.cache.memory.capacity
Controls how much memory is used to cache pages.
Right click on the page and choose New then Integer and create an integer called browser.cache.memory.capacity and set it to a low number. This controls how many kilobytes of memory are used for the browser’s cache.
NOTE: number in screenshot is too small. Aim for 80% of whatever the default is.
#3: browser.cache.disk.capacity
Controls how much disk space is used to cache pages in kilobytes.
Set browser.cache.disk.capacity to between 5000 or 15000.
128MB to 512M -> 5000.
512BM to 1GB of RAM -> use 15000
#4: config.trim_on_minimize (optional)
Configure Firefox to swap memory to disk when minimized. This will make Firefox less responsive if you minimize/maximize a lot, but it is good if you need to free memory while multi-tasking to other applications.
Right click on the page and choose New then Boolean and create a boolean called config.trim_on_minimize and set it to true. Now when you minimize the window it will free up memory.
#5: network.prefetch-next
Network link prefetch will download all pages with the rel=”prefetch” tag. This uses up more memory than you would otherwise think.
Set network.prefetch-next to false.
#6: browser.sessionhistory.max_total_viewers
This controls how many pages of history are kept in the back/forward buttons. Lower the value to something acceptable. If you do not use back/forward often then you can set this very low.
Set browser.sessionhistory.max_total_viewers to a low number.
Related Posts
- Synchronize Google Calendar with anything
- Internet Explorer 7 Uninstall Guide
- How to remove text from the autocomplete box in Firefox or Internet Explorer
- Firefox boss key extension
- All posts tagged Firefox
Further Reading
Ryan at CyberNet installs 200 Firefox extensions (via Rooster) and checks memory usage. It jumps from 145 MB to 195 MB after two hours (note that this is a worst case scenario).
Mozillazine article on reducing memory use in Firefox.
This is really useful! Thanks!
[…] How to fix the Firefox memory leak (Firefox hack) « //engtech (tags: firefox memory leak fixes?) […]
Awesome blog, great article. I added it to my blogroll, hope you don’t mind. I really like what you were able to do with Sandbox – if I do not have to purchase the CSS upgrade to mod it, I may switch over myself.
Thanks symbolik.
It’s comments like yours that keep this fun to do.
The CSS upgrade was a *lot* of work (I’ve never used CSS before), but it was more satisfying than dealing with a pre-packaged theme and the issues most of them have.
Only I can manage to screw this up. I managed to create a key with String instead of Integer for the first one, and now I can’t change it! ggrrr.
Thank you – excellent tips and all in one page.
Added to my ff settings. :)
Wow, your firefox hack is awesome. I kept watching firefox use more and more memory till it finally would crash. Very annoying and I couldn’t find a solution anywhere. Then, once I noticed how much memory firefox would use when it was active for awhile, I realized it was a memory leak. A little googling and then I discovered this blog. What a difference it’s made in Firefox’s performance. Muchas Gracias for sharing this knowledge.
I’m glad you found it useful. It really is essential to getting Firefox to work.
I’m suprised this isn’t better known – even among the incredibly IT-savvy people I know, they see this memory leak as an insoluble problem. I’m looking forward to sharing this article with them, as the “memory leak” is probably the most-publicized Firefox fault.
Many grateful thanks!
The other big cause of memory problems with Firefox is Flash… but I think that was fixed in the latest Flash update.
Of course, all of these settings, while they will reduce memory usage, will do so at the cost of speed. Caching more results will make pages load faster. If you have the RAM to space, you might not want to make these changes.
Can’t you also change the cache settings from Tools/Options/Privacy…or is that different from tweaking them in about:config?
@alan:
Tools/Options/Privacy is for clearing the cache. About:config is used for setting values for disk/memory cache.
Different things.
There’s a problem with #2. You say “This controls how many megabytes of memory are used for the browser’s cache.” But on the Mozilla site here (http://kb.mozillazine.org/Browser.cache.memory.capacity) it says this value is kilobytes.
@Michael:
Thanks for that. Corrected.
thx a lot man.
it’s all, see ya.
Thanks for the suggestions.
Can you offer a better suggestion for #2 other than “80% of the default”? If this is a new key, I don’t know what the default is. Something like what you have done for #3 would make this excellent list even better.
Thanks
It is utterly ridiculous that a user should have to go through that many steps to get Firefox’s memory “under control.”
OR you can just change:
browser.cache.memory.leak
from 1 to 0
I hope you like looking at that huge number of unused memory in the Task Manager.
@Jon: The defaults are as follows. Use a smaller number.
Physical RAM Memory Cache (in KB)
32 MB 2048
64 MB 4096
128 MB 6144
256 MB 10240
512 MB 14336
1 GB 18432
2 GB 24576
4 GB 30720
8 GB and up 32768
@JoeB: “I hope you like looking at that huge number of unused memory in the Task Manager.”
Did I need to prefix this article with “only apply if you’re having memory problems”? I run a VM-Ware linux machine on my desktop that uses up all available memory. I like to keep Firefox opened for quick reference, but I want to free the memory for VM-Ware when Firefox is minimized.
engtech…thanks for the reply, but I’m still confused. I’m using Firefox 1.5.0.9, and under Tools/Options/Privacy there’s a box where I can manually set the number of MB of disk space for the cache. Is that different than using about:config? Thanks.
I submit that your VMWare problem is special and that ordinary Firefox users have plenty memory to spare on caching. I can’t fathom why someone would sacrifice usability for a large amount of free and unused (!) memory.
Presenting these hacks without clearer caveats does everyone a disservice.
@Alan: That’s for disk cache, so it may be the same as #3.
@joe: This is a guide for people who have memory issues with Firefox, not a guide for people with a large amount of unused memory.
[…] How to fix the Firefox memory leak (Firefox hack) (tags: software) […]
[…] Fixing the Firefox Memory Issue […]
[…] How to fix the Firefox memory leak (Firefox hack) « //engtech (tags: firefox hack tips sysadmin) […]
[…] How to fix the Firefox memory leak (Firefox hack) « //engtech (tags: Firefox Hack) […]
[…] Bu adreste bulunan yöntemlere göre düzenlemem sonucunda %30 oranında performans artışı sezdim. Firefox 2.0′ı düşük hafızalı bilgisayarlarda kullananlar için gayet güzel bir çözüm gibi görünüyor. Ozan Kilic05/02/2007 0 kez pohpohlanmış “Firefox hafıza problemine bir çözüm” başlığına kimse yorum yazmamış […]
[…] How to fix the Firefox memory leak (Firefox hack) […]
[…] 目前最令人頭痛的問題之一,應該就是 memory leak。今天從 //engtech 看到 How to fix the Firefox memory leak […]
[…] als man es ihm zutrauen würde… Viele Sachen kann man letztendlich abstellen, wie dieser Artikel zeigt. Naja… Fand’ ich wichtig mal zu […]
If your tips are so good then why doesn’t Mr. Firefox include them by default? I smell something fishy here.
Thanks – I’d been having a memory leak problem, hopefully this will do the trick.
Heh, there’s nothing fishy about this. Back before Firefox was “a gleam in someone’s eye”, Mozilla (the browser) had a similar but opposite issue. When you maximized a browser window after having it minimized for some time, it took a very long time to come up. Searching their forums way back then, I found the solution: add “config.trim_on_minimize” to about:config and set to false. These days most people have much more RAM to allocate, so the devs take advantage of that, by default.
You can’t just type some random thing and have it affect the browser. Firefox has to recognize the entry, and if it does, that means it was designed to.
It would be nice if they would put some sort of easily accessible Advanced Settings panel in so users could make changes to suit their preferences regarding memory usage. But given the average user, they probably feel it’s best to keep these settings hidden.
[…] Have you noticed that Firefox can be a memory hog (still not as bad as IE7), especially when you have lots of tabs open? This might help. […]
I made your requested changes and saw memory usage drop by about half. However since I made the changes firefox crashes on me 2-3 times per day. Since almost 90% of my work involves the use of ff I guess I am going to go back to original settings. I am using the latest version of ff and it is (unfortunately) running on windows crappy (i mean xp). Has anyone else had crashing problems after making the above changes? did you solve them with out reverting to the original firefox settings? Thanks for any help or tips.
[…] engtech 的文章 “How to fix the Firefox memory leak (Firefox hack)“,有五個 Firefox 的隱藏設定可減低 Firefox […]
THANKS!!!
[…] up many results on “Firefox leaking memory”, but nothing solved my problem. I tried EngTech’s solution & couple of other solutions. More tinkering around pointed me out to a plugin, which was the […]
Thank you for your great tip, my firefox works great now!!
My firefox never crashes but it does use over 150MB if left un touched for hours and hours. Thanks for these tips, I hope they help
I have noticed that excessive CPU usage by Firefox occurs in conjunction with excessive memory usage. The “MultiMeter” downloadable sidebar gadget for Vista is helpful in monitoring this. I currently use Firefox 2.0.0.3, and it has the setting “browser.cache.disk.capacity,” but not the option “browser.cache.memory.capacity.” Anyone know why this is missing?
PS: May I suggest that your blog entries should have dates attached to the titles?
Hi,
thanks for all the tips, I am having memory issues with firefox, it seems to “hang” at times and doesn’t react to tab changes or when writing something it just stops….
I applied the above “hacks” but the trim on minimize doesn’t seem to do anything…. I am around 200 mb, the about:config shows that I have set true for this but still, when I minimize it doesn’t go down a bite! (I have restarted firefox and even the PC completely) Do you have any idea why this doesn’t work?
[…] How to cahnge how much memory Firefox uses. couple interesting options you can play around with. […]
[…] this problem, I was quite glad to find this tutorial on how to solve the Firefox memory leak: how to fix the Firefox memory leak (Firefox hack). I followed the instructions and have been able to improve Firefox’s memory usage efficiency, […]
[…] searched and even this article was not able to help till much extent. Starting firefox will take the memory usage to 60k memory . […]
[…] : Voici deux autres liens qui peuvent aider : How to fix the Firefox memory leak (Firefox hack) reducing memory use in Firefox Encouragez-moi en soumettant cet article aux digg-like : Ces […]
[…] Sumber artikel dan gambar diperoleh dari situs Internet Duct Tape. […]
[…] http://internetducttape.com/2006/12/02/how-to-fix-the-firefox-memory-leak-firefox-hack/ […]
[…] been hacks to solve this problem n MozillaZine, and a summary version of the hacks can be viewed at InternetDuctTape. It is a hack, a suggestion on how to optimize memory usage of Firefox for your computer […]
[…] How to fix firefox memory leak (firefox hack) […]
[…] Untuk lebih lengkapnya dapat Di peroleh dari sini […]
[…] when Firefox crashes because of memory problems I don’t have to wait five minutes for the error reporting dialog to pop-up. This entry […]
just another big thank you. :) FF was hitting 400 MB of memory in Windows and in Linux. With the combination of tab-mix plus, the tab-close-undo option, FF’s memory, and running ~20 tabs. I knew what was causing it but didn’t know where to fix it — now I do.
[…] i hear it gets worst the more RAM you have on your system. does this happen to you? i tried this and i guess it does help it a bit. but seriously disheartening to find my RAM being eaten up so […]
i don’t use firefux.it has so many
security flaws it looks like a piece of swiss cheese
[…] I would run a search on this, hoping to find a solution. And luckily I did. This website explains how to fix the Firefox memory leak. Let me summarise the […]
[…] couple of tweaks to “temporarily solve” this issue. For those interested, you can read How to fix the Firefox memory leak with a couple of interesting […]
[…] How to fix the Firefox memory leak (Firefox hack) « // Internet Duct Tape Reining in the ravenous red panda (tags: firefox memory hack howto browser tips) […]
150??? Christ, I’d *love* that! Mine was using 880Mb today Eight hundred and eighty.
@ Gilbert Wham:
One person I know regularly complains about GIGs of memory being eaten up by Firefox.
The good news is that Firefox 3 (out soon) fixes most problems.
[…] while I’m in Mozilla flame mode, exactly when will Firefox stop leaking memory like a sieve by default and routinely bringing my machine to a grinding halt? That would be a much […]
[…] is your own words: And while I’m in Mozilla flame mode, exactly when will Firefox stop leaking memory like a sieve by default and routinely bringing my machine to a grinding […]
Thanks for this! Firefox was up to 1,400 MB today. I was getting fed up with it. I work with ColdFusion and Dreamweaver, don’t know if the constant refreshing, multiple CSS and JS includes make it worse. But I’m very happy to see that it’s been addressed.
@carmen schmidlap & maybe others
what is it you don’t like about swiss cheese? most of them don’t have any holes at all, so it may just look as you don’t know what you’re talking about. and considering the holes iexplore definitely has, it’s all about chosing a software that suites your needs and doens’t ruin your computer as soon as you have it running (or installed? sorry if you’re running windows, because then it seems you don’t really have much of a choice or do you?)
ps: yes I’m swiss. and I love good cheese. and maybe some people should stop eating crap that comes out of cans that only have “cheese” written on the label but has nothing to do with the real stuff (this also applies to chocolate-flavoured strawberries, blue chocolate and bright-red-but-tasteless tomatoes). if you quit buying this crap, well maybe they’ll stop selling it. oh yeah, this also applies to software.
When I did this, my Firefox MB usage shot up to 70MB! Is that supposed to happen?
[…] How to fix the Firefox memory leak (Firefox hack) « // Internet Duct Tape config.trim_on_minimize (tags: firefox memory tips) […]
Wow, thanks!
so clear and fast!
now i`ve gotta do it to the rest of the office heheh
Gracias compadre!
@ Richard Watt:
At this point I would just wait for Firefox 3.
Firefox 3 will fix this memory problems.
[…] Check this out… I have a feeling this will explain what is happening on your system…. Firefox Memory Usage __________________ Yes…. I Am Teh MeTh0Dz….. And, Yes…. I Like Teh […]
I found an great to get your ram usage to 30,000mb.
go to the about:config screen like always,now find these two codes and turn them to false.
look up this: network.http.pipelining.ssl
network.http.pipelining
now reboot your browser and e-mail your results to me at
evan93333@yahoo.com
[…] than necessary. While there are several places that you can read up on this, I would recommend the Internet Duct Tape blog and the mozillaZine article, “Reducing Memory Usage.” I ended up changing some of […]
You are awesome! My firefox works now. I don’t mind donating to a site like this. I am very happy.
Thank you.
Wow!
Nice tips, thanks for sharing
Yeah, sadly my Firefox uses well over 1GB to run a couple tabs all day. IE is so much faster for me but no unsafe so i don’t use it. I’ll be trying these tricks and see whats up, although i have 4GB of ram it’s very un nerving to see Firefox use more ram than Vista.
[…] http://kb.mozillazine.org/Reducing_memory_usage_-_Firefox http://internetducttape.com/2006/12/02/how-to-fix-the-firefox-memory-leak-firefox-hack/ […]
Roy- Since no one addressed your question about incorrectly entering/naming a new preference name:
All you have to do is r-click the value and select reset. Bounce FF and the newly-created preference name will be gone.
Hope this helps!
#6 on my FF#3 it shows a minus 1 for this value:
“Set browser.sessionhistory.max_total_viewers to a low number.” did you mean Set “browser.sessionhistory.max_entries.” instead???
#2 in FF#3 there is no “browser.cache.memory.capacity”
did you mean “browser.cache.offline.capacity” instead???
[…] testoasa beata. Da, de multe ori vulpita e de vina (ca sa ramanem in domeniu). Sunt si solutii: aici, aici, aici si in alte zeci de locuri. In firefox 3 problema e parca putin mai […]
[…] http://internetducttape.com/2006/12/02/how-to-fix-the-firefox-memory-leak-firefox-hack/ Filed under: Allmänt […]
You’re the guy…
This was really helpful.. Thanks man.
WOW, SO much faster. I thought there might have been a memory leak or something weird memory wise going on with fire fox. I would have to force it to close any time it sat for a couple hours. I just made the change, so time will tell if it fixes it. However, it is many times faster when just viewing a web page. I can hardly believe it is the same computer. Thanks.
These tips are great! I love firefox, but mine frequently took over 500K of memory according to the task manager. I thought the memory usage was coming from the addons, but using these tips keeps FF3 under 150K constantly. I am SO glad I found this page. Excellent!
holy crap, this is like finding the lost city of Atlantis ! My memory usage for firefox 3.0.4 has gone from 297 meg down to 68 meg and I am loving it !
I have 2 gigs of memory but I run many apps and while I love firefox I was about to start looking for another browser because of this problem but now I can keep using my favorite browser and it will no longer eat up my resources, thank you thank you thank you !
[…] Ive stopped using FF3 for the exact same reason (Mac BTW), Ive switched to Camino which based on Mozilla’s Gecko engine, uses less resources. Im going to play with the 3.1 beta for a bit and see how that fares this week. There are a few *fixes* for the memory leak by editing the about:config but they didnt make much difference for me How to fix the Firefox memory leak (Firefox hack) // Internet Duct Tape […]
merge ..am redus memory leak de la aprox 800mb la 130mb
order Aristocrat
This was a life saver. When Firefox was running I was routinely using 52% ram. It got worse as it sat and sometimes just clicking the mouse would take it to 100%. Closing the program did not free it up. Since making your changes, I just hit 11%. What a difference.
Thanks :)
that’s good news….
thank’s bro, i will try it
since this is old i ask: is this outdated?
for some reason my config doesn’t have browser.cache.memory.capacity? o w o;;
ahhhh. = w =
Thanks for the info!
Did not reduce the hogged memory.
In no way.
http://www.ubuntugeek.com/speed-up-firefox-web-browser.html
Thanks,bro.
Firefox becomes suck and suck these days partly due to addons.
TX
D: YOu make one
Hey dude, thanks a lot for this post. I’m running fluxbox over here cause I want everything to be fast, I only have a gigs worth of ram so firefox usually clogs most of it, thankfully youve helped to reduce the load and speed up my firefox, cheers dude :)
Did not reduce the hogged memory…
Agree with you.
SOmetimes we might forgot what the basic.
Thanks, man.