Subscribe to How-To Geek

Recommended: Click Here to Run a Free Scan for Common PC Errors   [Sponsored Link]

Fix for Firefox memory leak on Windows

This seems to help out with the memory usage quite a bit. Generally, when you minimize a window the memory usage goes way down because that application isn't active. Unfortunately, Firefox by default doesn't adhere to this behavior. Here's how to force it to.

Type the following into your address bar in Firefox:

about:config

You will see a window that looks similar to this:

You will want to right click anywhere in the window, choose New, Boolean, and enter in the following text:

config.trim_on_minimize

To change the value you can either doubleclick, or right-click and choose Toggle. You will have to restart Firefox, but after you do, you should notice the memory usage go way down whenever you have Firefox minimized.

Update: You will want the value to be set to True in order for this to work.

The Geek is the founder of How-To Geek and a geek enthusiast. When he's not coming up with great how-to articles, he's probably writing at his personal blog. This article was written on 09/11/06 and tagged with: Windows, Firefox

Comments (27)

  1. roland

    you forgot to mention that the value of this config.trim_on_minimize should be set to true

  2. Craig

    surely if the value is true it should be boolean not string?

  3. The Geek

    Craig,

    Thanks for pointing that out…. I updated the article to reflect that.

  4. Demon

    It can be a string too, when you type in YES as value… it works

  5. Your Brother

    Hey, thanks!…. that has annoyed the crap out of me for quite some time….

  6. Malcolm

    Does this apply only to Firefox 1.5? Is it necessary/helpful/needed on Firefox version 2.0?

  7. The Geek

    Malcolm,

    If you aren't having memory problems on 2.0, then don't worry about it. Some people report normal behavior in 2.0, some people still have memory leak problems.

  8. WALTER Earnshaw

    Hi
    Your config_trim_on_minimize tip:
    I don't have that ref name in my about:config
    Is there an easy way to do it?

    elwaltura

  9. Jim Hamm

    To The Greek, thanks for the tip. Right now Firefox 2.0 is about 85MB in memory usage, and may drift over 100G as time goes on. On first start-up, it is about 35MB. You stated "if you aren't having memory problems on 2.0, then don't worry about it". In your experience, what memory usage for FF is "normal" and what would be considered a "problem?. BTW, my OS is now Vista. Thanks, Jim

  10. Jim Hamm

    Correction: I meant 100MB in memory usage, not 100G…Jim

  11. Adam Nugent

    I've also been writing tutorials on Firefox, this is one that I've added myself, although my style is based more on the assumption that my viewers are new to computing.
    Planing on Writing all the Tutorials I can on Firefox so if anyway knows of more i would be greatfull if you could give me the heads up so I can write my versions.

    Your tutorials are great for people like me there simple and straight to the point.

    Thanks

  12. ali

    waw , thanks a lot

  13. Justin

    I'm not having any luck with this fix. I've followed the instructions exactly, but when I minimize firefox the drop in memory usage is exactly 8k every time (not 8,000k). For example, mem usage is now at 72,328k with only this tab open; if I minimize it drops to 72,320k. I've tried driving mem usage up well over 100,000k, only to minimize with this same change. It would be great to get this to work - I've always had memory leak problems with firefox. Any advice would be greatly appreciated.

    Specs that might be relevant: Vista Home Premium 64-bit, 4 GB ram, Firefox 2.0.0.4

  14. Ronin Vladiamhe

    What kind of memory usage drop should one expect? I use FireFox portable (v2.0.0.4), which can't be much different than having it installed on a pc. Memory usage drops about 600-700K when minimized. Even when minimized, isn't it still 'active' and using memory.

  15. Angad

    @ Ronin
    I use Firefox 2. The memory drop I got was from about 75,000 K to 14,000 K.

  16. Beepo

    This is very misleading. The behavior you describe is not a memory leak. Firefox did have a memory leak issue in some of the early versions but there are no known leaks today. What you are describing is caching. To put it simply and in layman's terms Windows is reporting that it has a large amount of RAM that is not in use so Firefox uses this memory for caching to speed up browsing. The instant Windows needs the memory it automatically performs the trim. Since this is all in RAM there is virtually no delay in doing this.

    Whether this is good or bad is left to the user, the developers thinking was that if the RAM is available you may as well use it. Otherwise it's memory you paid for but aren't getting full use of.

    I would also caution that even though all known memory leaks have been resolved in current versions of Firefox there probably are still memory leaks in many extensions. For those, I don't believe the trim on minimize setting will help.

  17. james

    I have Linux version 2.0.0.4. It does not have a "config.trim_on_minimize". Perhaps we all need to specify more fully lest we conclude Firefox is released on-the-fly.

  18. Ben

    On Windows XP, I got drops from 120MB RAM down to just 8MB (I didn't believe my eyes!), rising to stabilise at 32 MB soon after re-maximising.

    On Ubuntu Linux, the tweak doesn't appear to work, but now I use SwiftFox, a Linux-specific build of Firefox that's much faster anyway.

    Firefox is better on Linux than on Windows, and SwiftFox just blows my mind! It's even faster!
    http://getswiftfox.com/

  19. Ricky Croissant

    I tried this config alteration and experienced an unusable browser. My homepage (Google) would not load.

  20. Ryan

    While this fix works fine for Windows XP, it does not work with any versions of Windows Vista. Actually, it may work, but the results are very minimal.

  21. Chris

    My environment is as follows:
    Firefox viersion: 2.0.0.1.0 Japanese version
    OS version: Windows XP professional 2002 SP2 Japanese version
    I don't get any luck using this method to minimize memory usage when I minimize firefox.
    Are there any extra things to do? Or is it because my firefox is the newest version?

  22. Chris

    I have just upgraded my firefox from the version 2.0.0.10 to 2.0.0.11. This time it works amazingly. Consuming memory 50Mbytes changes to 8Mbytes after minimizing firefox.

  23. Ronin Vladiamhe

    Chris, did you use the 'Fix for Firefix Memory Leak" or is it simply the result of a newer version of FF?

  24. Chris

    Actually I found that I had a mistake.
    I should have set "config.trim_on_minimize" instead of "config_trim_on_minimize".
    I think that it worked because I set the config correctly
    not because I updated a newer version of FF. It happened coincidentally. So I misunderstood that
    updating FF took effect on the lower consumption of the memory when minimizing FF.
    Any way it worked as you suggested to.

  25. TJ

    I'm using XP Pro with Firefox 2.0.0.12 and this tweak did not work for me. On minimizing firefox, the memory usage dropped by less than half of 1M.

    If "Beepo" is correct; that is if there is no actual memory leak in the latest versions of Firefox; Firefox just grabs unused RAM for caching websites in order to speed up browsing; Does anyone know if there is a way to limit the amount of RAM that Firefox uses for caching?

  26. TJ

    Here is an answer to my own question that I found at http://kb.mozillazine.org/Redu....._-_Firefox

    The config.trim_on_minimize setting (Windows only) does not reduce the amount of memory used, it just swaps memory from RAM to disk. This may make Firefox slow to "wake up". If config.trim_on_minimize is left set at the default value (false), the memory will be swapped to disk only if it is needed by another application. Therefore, for most purposes the default value is recommended.

    Changing the about:config preferences below may have an effect on memory consumption but may also affect performance or reduce functionality. Read each article for the preference's effects. Each preference includes an estimate of the amount of memory that can be freed on an average (512MB RAM) system by choosing the most memory-friendly setting.
    Preference Max memory freed
    browser.cache.memory.capacity and browser.cache.memory.enable 14MB
    browser.sessionhistory.max_total_viewers 20MB

    The RAMBack extension, available for Firefox 3, allows the user to manually free memory, such as caches, that is usually used to increase performance. This gives the advantage of small cache sizes without having to always suffer the performance hit.

  27. Saurabh

    hey brother,
    thanks for sharing a info. but unfortunatly it did not helped me as it should do. When I did the thing according to your way, the consuption of memory got a bit HIGH instead of going down.

    Waiting for a reply.
    Regards


Leave a Comment




Leave your friendly comment here. If you have a computer help question, leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Copyright © 2006-2008 HowToGeek.com. All Rights Reserved.