Neil Turner's Blog

Blogging about technology and randomness since 2002

Memory leaks in Firefox

One of the long-running complaints about Firefox has been its memory usage. Like most web browsers Firefox does need a fair bit of memory to run, but it’s also had long-running problems with memory leaks – memory that is allocated unnecessarily or memory that is allocated and not given back when it’s finished with. These mean that Firefox needs more memory to run and over time its performance (and the performance of other applications) starts to degrade.
Last month, a memory leak detection tool was made available to users testing the trunk builds (which will eventually form Firefox 3), which allows memory leaks to be detected and reported. Jesse Ruderman has posted a progress report and already a total of 12 memory leak bugs have been fixed. Two of those were included in the 1.5.0.1 fix that came out last week (download it if you haven’t already) and the other 10 may get included in future updates. More reported leaks have yet to be fixed.
It’s great to see this being addressed, though. I’ve seen a number of people lamenting issues with Firefox’s memory usage, including some who have claim to have to restart Firefox every couple of hours or so to retain good performance. Hopefully these fixes and any more that are discovered will go some way to alleviating Firefox’s memory eating habit.

8 Comments

  1. The trunkbuilds seem to use 10% less memory after opening a few hundred sites in tabs and then closing them but thats still 92MB MEM for me with 140VM and only 1 tab open.
    If there is only 1 tab Firefox shouldn’t use more than 30MB should it?

  2. I tested it and I really like the memory detection tool…

  3. I must check this tool out I have serious issues – http://filepile.davidoneill.net/mem-usage.JPG

  4. Dave: Okay, that’s just ridiculous – I’ve never seen anything like that ever. Highest I’ve seen on my laptop was 150MB and that was having used lots of plugins (QuickTime, Acrobat, Flash, WMV etc) all in one session.
    What extensions are you using, and does that still happen if you disable some/all of them?

  5. In fairness that’s about twice what it normally runs at but I just had to get a screenshot when I saw that!
    At the moment it’s at 310MB, I’ve got around 20 tabs open and FF has been running for two hours. I do have a lot of extensions but most of them are ones most people use. I’ve disabled Greasemonkey in the past and seen an improvement.
    Mostly I think it’s probably due to a Firefox profile that’s about 2 years old and that’s been migrated through loads of version.
    Java kills me sometimes.

  6. I’m one of the ones that has to restart Firefox every few hours because of memory leaks…but only at work, on Win2k. At home, on XP Home, it runs fine and dandy and I almost never have to restart the program. I’m not sure what other differences might be lurking in the two installations, but I’ve learned to bring a book or something else to do for when Firefox slows up the whole machine.

  7. Incidentally Firefox with the same extensions runs fine on Linux in work.

  8. mine normally hovers around 150mb – which is an awful lot considering I only have 512mb to start with.