nullstream weblog - Firefox Memory Leak


« Picasa 2 | Nullstream FAQ »

Firefox Memory Leak

February 19, 2005 10:37 PM PST

I like Firefox a lot and have stopped using IE. BUT - FireFox has a huge memory leak. I see the same problem as this guy. After a few days, with a couple tabs open, the memory usage grows to > 250MB. I actually had a "low on virtual memory" warning in XP recently. Even closing all tabs and having a blank start page doesn't solve the problem. I've also tried the "browser.cache.memory.capacity" trick and it doesn't help. Interesting points on this issue:

It is pretty ridiculous that I actually put up with this leak rather than switching back to IE. It just goes to show how much more I like Firefox.

Comments (21)
Paul, February 19, 2005 11:30 PM:

You also don't switch back to IE since that is the most dangerous piece of software ever created. All it takes is one typo in the address box and your pwned, d00d.

Paul, February 20, 2005 10:32 AM:

When I boot up my machine, the first thing I launch is Firefox. The tab order:

1. Corporate email
2. Personal GMail
3. Google.com
4th - Nth tabs are opened by clicking on links in my RSS reader (thunderbird). I have firefox configured to open a new tab instead in the existing browser rather than a new window, so I end up with loads of open tabs when reading RSS feeds.

I agree about the memory bloat, but it hasn't caused a crash for me yet (I've got 1 GB or RAM at home), and on my work machine it runs for days at a time without a problem. I really suprised that no one is tracking memory leaks.

Then again, we all come from GoAhead with BALLOC or whatever so it was super easy to do a memory dump. You can do it for Windows programs described here.

Maybe I'll do a mozilla build on Windows with this and see what is going on.

W3ird_N3rd, February 20, 2005 11:54 AM:

I've had a total memory usage of >1GB for several times, after shutting down Firefox only

The leak does exist, but over time it's now not as bad in 1.0 as it was in Firebird. With Firebird, I was running quite fast to huge memory usages, and after less then a week, the browser couldn't display pages correctly anymore. FF 1.0 slows down after a week or so (with 512MB of ram and intensive browser usage), but doesn't crash. Yes, I need to restart it after a week. But I remember I've had the same problemen with IE and Windows 98, I'm not sure if Win2K/XP fixed this.

However, a good solution for me is to copy-paste al links you have in tabs into notepad or something similar, shutdown Firefox en copy-paste your links back into tabs.

W3ird_N3rd, February 20, 2005 12:02 PM:

Unfortunately, you're weblog seems to be incapable of understanding my "180 degrees turned >" I wrote for "less than 300MB". Not only Firefox has a bug, you might take a look at your weblog-software too ;-)

What was lost : "after shutting down Firefox only less than 300MB was left. And you're making a problem out of 250MB? :-)."

J, February 20, 2005 12:36 PM:

The weblog software is MovableType. We have HTML in comments enabled, so it thinks the greater than symbol is part of a HTML tag. You can use the text > and < to specify greater and less than.

As for saving the tab state, I've actually started just dragging the URL into the quick launch bar for temporary storage.

I haven't had it crash either, but I have had it spend over a minute paging to the disk when brought to the foreground.

J, February 20, 2005 12:40 PM:

Paul, I think you mis-typed, the order, as I understand it should be:

1. Corporate email
2. Personal GMail
3. Google.com
4. nullstream.com
5th - Nth tabs

:-) So do you have those initial sites in a folder and then use the folder as your home page? That would autoload the sites at startup, right?

John, February 20, 2005 01:23 PM:

That is pretty surprising for a 1.0 release. It is normal release procedure in a commercial app to look for stuff like that there are harder things to find. This should have been noticed before 1.0 due to all the users the pre-release had.

Paul, February 20, 2005 02:00 PM:

I probably should make them a tab group that launches at startup, but I pretty much hammer the machine at startup time with application launching, because it's fun:

1. Firefox
2. Thunderbird and click "get news"... (this pretty much pegs the CPU and fills up the network card with RSS queries)
3. iTunes
4. Visual Studio .NET
5. Cygwin bash
6. MSN Messenger
7. Google Desktop Search (automatically starts at login)

I do all this in the space of about 3-4 seconds, just to race the apps. iTunes and VS.NET are absolute dogs starting up: "... first I must check each sector of the disk, just to make sure it's still there..."

J, February 21, 2005 12:06 PM:

One interesting thing is that if you minimize Firefox, the memory usage goes way down - to just over a meg. I guess that's a standard windows thing.

iTunes is definitely a pig dog. You should probably bring picasa up too by default. Just for good luck.

I do not mess around with Cygwin. I just have the VNC session going if if I have a Posix hankerin'. Any of you guys try the "Windows Services for Unix"?

Paul, February 21, 2005 01:26 PM:

I use cygwin since it's needed for building Firefox, and has a bunch of useful things (python, lisp, perl, subversion, etc) that I use regularly.

I haven't used Picasa as much (yet)...

Ian, February 22, 2005 01:34 PM:

The SessionSaver extension is a pretty good fix for this problem. It just opens Firefox as it was closed, tabs and history included.

Sorry to just drop in . . . I'm a friend of J's sister. I get payed to sit at my desk and look busy so I have to find things to do to keep myself from falling asleep . . . like reading the blogs of people I don't really know.

J, February 22, 2005 03:22 PM:

Ok, I installed it:
SessionSaver
It definitely remembers your tabs and page positions. If you have tabs up, it takes a while to load all the pages on startup, but it seems to work reasonably well.

I closed the browser while writing this comment though, and the comment disappeared, so it doesn't save EVERYTHING. But this is definitely close enough. Thanks for the tip!

Peter, July 11, 2005 12:06 PM:

I've had this problem too, for the same reasons (XP Home). I've also noticed that if I shut down the computer while the memory usage is so high, I get a "program not responding" message indicating the DDE Server. Is this related, and does it point to a possible solution?

J, July 11, 2005 01:39 PM:

The problem is still there on the latest version (1.0.4). I don't have any DDE issues or anything, it's likely unrelated. I'm at 200MB right now, but I have 1GB ram, so there's room. If you minimize firefox, you'll see the memory usage drop down to about 2MB, although it can grow from there. So, the workaround remains: use SessionSaver and periodically just close firefox down and restart it.

My guess as to the problem is that there are leaks in the JavaScript implementation. Since Firefox itself is written in JavaScript and XUL, it's probably leakin' all the time.

ronan, July 23, 2005 03:38 PM:

i think the issue comes from cache memory as we can see with "about:cache" that the limit you enter only concern the disk cache but firefox also maintain a memory cache that has no limit...

Kulima, July 24, 2005 12:02 AM:

Using Firefox 1.0.6
While searching to solve the problem of a
- Blank History Tab - came upon this site.
About:config is on 9 days save.
Can anyone help a novice?

Twinmama, August 20, 2005 09:25 AM:

This may help:
http://www.freerepublic.com/focus/f-bloggers/1327586/posts

J, August 21, 2005 10:52 PM:

Yes, I've tried the 16 mb config setting, it doesn't solve this problem. You'll see on other sites it doesn't help in this case. The about:cache is a cool display - I hadn't seen that.

J, August 22, 2005 06:49 PM:

I hit 670MB of memory usage last night in firefox - a new record. After exiting and restarting with the same tabs, it was back down to normal. Whether you call it an unbounded cache or not - it's a bug.

J, May 27, 2006 09:33 PM:

I'm currently running Firefox for Windows 1.5.0.3 and still average about 175MB. I have not seen the extremely large (> 500 MB) memory usage recently. Minimizing the browser no longer brings the footprint down. SessionSaver is still the best way I've found to reduce the problem. Every couple days I just close the browser and re-start it to regain memory.

Paul, May 28, 2006 12:43 AM:

One day, you'll look back on this and laugh: "500MB!?! You can't even compile 'Hello World' in Z# in less than 42 GB!"






All links will be marked with the nofollow tag, making them useless for search rankings. Any posts containing spam URLs will then be deleted.