Firefox Working to Fix Memory Leaks
Christopher Blanc writes "Many Mozilla community members, including both volunteers and Mozilla Corporation employees, have been
helping to reduce Firefox's memory usage and fix memory leak bugs lately. Hopefully, the result of this effort will be that Firefox 3 uses less memory than Firefox 2 did, especially after it has been used for several hours." Here's hoping. Frequent restarts of things on my computer make me furious. I can't imagine why anyone would tolerate such things.
Too many apps nowadays just throw out RAM like it was yesterdays newspaper! It is sloppy coding, and I'm tired of having to put 2GB of RAM into a system just to surf the net nowadays.
Karma Whoring for Fun and Profit.
I don't mind the memory. I have plenty of gigs even in my laptop. What I mind is the general slowness that I experience with Firefox, and that makes me use Opera on my laptop even though I would feel better using an open source browser.
c++;
Cue it's not a bug it's a feature. GO!
The bulk of the complaints about Firefox being a memory hog are due to features which simply need a lot of memory, not due to memory leaks (bugs). While it's certainly a good idea to check for, find and close memory leaks, the significance of this effort will not reduce the normal memory usage drastically. Firefox simply does things which require a lot of memory.
This is what has been keeping me off Firefox on my memory-lacking iBook.
I'm tired of Firefox being like a cartoon snowball rolling downhill: once the little bugger gets going, it just gets bigger and bigger until it becomes an unstoppable memory eating monster.
everytime I mentioned the memory issue I was always told it was a plugin or there was something wrong with my system or something about my mother and a donkey. Certainly firefox fan boys wouldn't have just attacked me because I questioned something...would they? :-D
Nobody forces you to use Firefox. You can use Opera, Konqueror, links or IE, or any other browser out there...
too little too late some people i know have switched to alternatives like Opera or back to IE7 (both use substantially less resources on windows) due to all that ram hogging
It runs well on your cellphone, Nintendo Wii/DS and pretty much anything else with a screen & network connection, So I think it's safe to assume it will work on your desktop.
Are there really any memory problems that cannot be cured by strict adherance to the rule of "allocate memory at the beginging of a routine, deallocate same amount at the end"?
line up the fanbois that refuse there can be anything wrong with firefox and memory consumption... for years people have asked what the hell is up with memory usage, and for years the same stubborn people has refused any problems..
I know. It's enough to make anyone consider using IE...
Frequent restarts of things on my computer make me furious
Shit Taco, what OS are you using? FF leaks on my OS X box too over time, but quitting the app seems to free up the memory.
Or maybe I'm not paying close enough attention.
I tolerate it with an extension that provides a restart button on the toolbar. There are several such extensions. It's also useful for when one wants to quickly restart after installing/enabling/disabling an add-on/theme.
And of course, said extensions reload Firefox with the windows/tabs you had open.
Gamingmuseum.com: Give your 3D accelerator a rest.
I can't imagine why anyone would tolerate such things.
Well, my guess is that you *are* tolerating it, as are millions of others, simply because you're using it (either older versions of IE, or current versions of Firefox). Can't comment on IE7 cause I don't use it much, but IE6 rarely crashed for me. IE3-5.5, almost daily crashes.
5 years ago people people would constantly belittle IE users because it had frequent crashes, and pointed to the 'superior' Mozilla suite. Today, FF has morphed in to something which can't be used, with plugins, for more than a couple days max without needing to be reset. I add the caveat in there about 'with plugins' because I'm not sure I know many people who run a bare-metal Firefox. Most people use one or more extensions. This has been a huge marketing push for FF - "It's lean! Only use what you need! Get rid of 'bloat' - package everything in extensions!"
Putting things in extensions makes the base 'leaner' but has lead to a situation where there's no centralized testing for, or even acknowledgement of, memory leak bugs (and other bugs, but this is the obvious one). I still read comments from people who claim they never have leaks with FF (we'll see some on this thread no doubt). It's not that I don't believe them, but their usage patterns are likely different from mine. I have about 6 plugins that I love to use, and I like to keep my browser going. The idea that MSIE is more "stable" than FF for daily usage should remind people that resting on your laurels is not an option. What cut the mustard 5 years ago isn't gonna cut it any more.
creation science book
Perhaps the culprit is C++. Languages with auto-garbage-collection or are database-engine-based tend to clean up automatically or cache to disk more effectively. C/C++ just seems to have so many low-level crevices to accidently mess up with.
Table-ized A.I.
What happened to the lightweight & responsive firefox (phoenix) as an alternative to pigzilla (mozilla)? Why and how have the bloat, memory leaking and focus stealing been allowed to get so bad? I still use Firefox 0.8 (zero point eight!) as my primary linux browser because the new versions blow chunks.
Focus stealing in everything past 0.8 happens with Focus Follows Mouse and keyboard shortcuts.. You close a window with a keyboard shortcut only to have the wrong window close due to focus stealing. Or the rendering in a background firefox window slows or blocks the rendering of a foreground window.
Even the crutch of a faster CPU can't fix these problems.
I haven't tried it myself, but would this be a temporary cure? http://www.freerepublic.com/focus/f-bloggers/1327586/posts
www.opera.com ;P
I completely agree. I only have 384MB on the machine from which I'm writing this. There isn't room on the mb for any more than that. I got totally tired of the system seizing up when I used to use Firefox. So I switched to Opera. That's not completely immune to seize-up/memory concumption problems either. So I'll keep an eye open for significant improvements to FF, and just possibly switch back if they fix the memory bugs.
I hope they won't totally forget the folks using older-specification systems, but I have my worries about the FF debugging process: I looked at the blog that was referenced in the article header, and some of the comments sound ominous for quality. The way some of them read, makes it seem as if patches to force memory-release in various situations are just going to be grafted on top of the buggy code. That looks like a recipe for performance loss, compared with the result of fixing the problems at their root?
-wb-
I can certainly understand why people are tired of FF memory leaks. Being a FF user myself, with open browser windows and multiple tabs all through the day, I have seen what happens to FF after 4-5 hours of intense browsing. And don't even get me started on the PDF and Flash plugins!
Some would argue that the problem is sloppy coding, or poor encapsulation (a typical OO programmers point of view). But please remember, that even though modern browsers are GUI apps, they are coded much like low-level server processes or protocol stacks. Low-level programming using languages like C and C++ gives you more control and better performance, but at the expense of nicer development features like garbage collection and encapsulation.
Think about it. Would you accept a browser that rendered HTML flawlessly and with absolutely no memory leaks, but took more than a minute to render each page? I think not.
It's an act of balance, and the problem is not _always_ "sloppy coding". It is the increasing complexity of these apps, combined with user demands which push the development towards low-level development languages. From a realistic point of view, any app. written in low-level C with as many lines of codes as FF, is bound to have bugs and leaks. (perhaps except code controlling nuclear reactors and NASA satellites, but then the price of each line of code is also somewhat different).
We - the end users - are not without blame.
- Jesper
My security clearance is so high I have to kill myself if I remember I have it...
Observing the existence of a memory leak, and knowing where to fix it in your code, are two VERY different things.
- Jesper
My security clearance is so high I have to kill myself if I remember I have it...
5 years ago people people would constantly belittle IE users because it had frequent crashes, and pointed to the 'superior' Mozilla suite. Today, FF has morphed in to something which can't be used, with plugins, for more than a couple days max without needing to be reset. Reality check: Most general users do not leave their browsers open for a couple days. Let alone a couple days max. In fact, I wager that most turn their computers off at the end of the day.
No I don't have a source for my statement. But ask people you know who are not in the tech industry. The one outlier group is Mac users, who don't realize that closing a browser window doesn't take the program out of memory.
Help! I'm a slashdot refugee.
One of the things they're adding is a time-based cache for unused images. For example, if after 5 seconds an image isn't used, it's freed from memory. This alone gave them a huge memory boost, IIRC.
There, two clichés in one post. I'm so sick of these...
"I still read comments from people who claim they never have leaks with FF (we'll see some on this thread no doubt)."
Here's one. I have 14 extensions running, haven't restarted firefox since yesterday, and have opened and closed a couple hundred tabs. Of course, I usually close firefox at least once a day, which it seems many people here do not. Still, Firefox is using 72 MB of memory, on a 2 GB system. After restarting, 67 MB. This is with 8 tabs open, 3 of which are mildly image intensive. What horrible leaks! But seriously, I've never seen firefox go over 100 MB or so no matter how much I abused it.
Excellent point about the problem with managing features in extensions, though... it might be nice if some features that got cut off and stuck in extensions were cleaned up every few versions and certified or even offered as optional check-boxes during new installs.
My biggest problem now is the fact that Firefox/Mozilla usually hangs when I watch Flash videos (e.g., youtube videos) on my ubuntu box. I don't think this has to do with memory leaks though. I have searched around the net for an way to fix the problem but I have not found anything. It seems to be affecting a lot of users though.
Maybe not, but in the Windows World, Opera is not a viable alternative to many people who find the Opera UI to be excessively daunting for casual use.
The thing that has irritated me about this is that for a very long time, the FireFox leadership has insisted that there where no memory issues, that it was a specific type of use profile, and that if you knew the secrets of how to tweek the configuration file, performance would improve. This is the lamest of excuses.
FireFox is not sold as some kind of "leet" hacker browser, it's sold as a browser for the people. FireFox leadership needs to be more responsive to the feedback from "AVERAGE" users if they want FireFox to be a major player in the browser world. 10% is nice, but it's still only 10%.
If you want news from today, you have to come back tomorrow.
Frequent restarts of things on my computer make me furious. I can't imagine why anyone would tolerate such things.
Because other browsers have their problems too, and I have to web browse with something.
It is because people accept poor programming as the norm. Oh, yeah, just reboot it and it'll be fine.
I consult for someone who uses ACT! 2005. When they got the upgrade notice, they asked me to check it out. I spoke to ACT! support and they told me "We improved performance by releasing resources that we are no longer using." I said, "THAT IS A BUG FIX!" Anybody writing code outside of school should be doing it, and if I was grading their code, I would take points off for that.
I'd like to see some of these software companies that do this get sued for such poor coding practices.
Fight Spammers!
I'm sure it's part of the problem. I wish Firefox's JS implementation were as fast as Opera's, or even IE's. Its GC makes it jerky as all hell. Like, just now, as I type into this dialog box.
After reading the threads, and noting the reactions, one has to consider the "Source". The difference between Close Sores, and Open Sores is that when you feel compelled to squawk, you can do something about it with Open Sores; But with Closed Sours You cannot. Try it with Microsoft, ask them to add the puny coding it would take to bring Internet Exploder up to CSS 2.0, or XSLT to 2.0, how about SVG 2.0 handling? But with an Open Sores solution, if you do not like it, you can change it, NOW! Maybe the submitter of the Parent Article could tackle the Memory Leaks of FF?
"Do you want some cheese with that wine?" - Unknown
1. Custom malloc/free implementation. (Yes, custom - not from libc.)
2. C++ new/delete operators, which for all I know may be overridden to use their malloc/free.
3. One of the first two with reference counting to decide when to free/delete.
4. JavaScript mark-and-sweep GC.
Dealing with this causes some truly insane hacks, like the absolutely insane DOM C++/JavaScript implementation. (They're C++ objects, exposed as JavaScript objects, using something that's like XPCOM but isn't due to the overhead XPCOM imposes. I really don't understand it.)
Ultimately, though, it's worse than all that. All this crap leaves the code completely opaque, and actively prevents contributors from contributing code without having to learn an insane amount of infrastructure decisions.
It makes a project that's supposed to be open source effectively closed off to only the "official" developers: almost open source in name only.
Cautiously avoiding the mention of anyones favorite O/S so as not to earn troll mod points; It all depends on where the leaks are. The only way to fix some of them would be to build a staticly linked executable. That still doesn't get you around kernel/driver bugs. In my experience, many apps that appear to leak quite badly on one system do very well on another.
Hint: Try setting "LEAKS=OFF" in the registry. ;-)
Have gnu, will travel.
I use Firefox on Mac (intel) and Windows, with the latest versions on both. I can have Firefox open for a full week on Windows without any problems, however on either Mac I have to restart Firefox about once every day or two, otherwise browsing slows to a crawl. At extremes the whole machine will start to bog down until I "force quit" (kill -9) Firefox. I'll also experience oddness where images will just stop loading.
Running "bare bones" on all Firefox installs, no plugins other than whatever may have been included with the base distribution.
Does anyone else notice this? I've switched back to Safari on the Mac in the meantime.
Interesting. I run Firefox with a few plugins. I leave it up all the time and have very seldom had a problem that wasn't related to a specific plugin - usually weather. I tolerate it because it is seldom. And since last update - not at all. As far as footprint 2,152K - hmm not too big... Especially with Explorer sitting at 6,524 K.
I am not a fan boy but really. Did you ever think the problem is not the software base but a plugin or indeed, the way you are using it or even something else on your machine?
As for bloat, bad coding is bad coding. Language is not the cause of bad coding. In C++, lazy can get you real problems quicker than other languages such as Java. However, all of them can get you into memory problems.
Well, seems like this is time to extol the joys of the C and C++ language, with their delightful scavenger hunt the whole team can play: Find the Memory Leaks! Seriously--can you imagine a more embarrassing thing for the developers of Firefox? You guys were so sloppy that we're expanding the hunt for your mistakes to a world-wide level. Gosh, they must be proud of their work.
Firefox does indeed crash sometimes. On my system, it can run for weeks without problem, but certain types of content (e.g. YouTube) can crash it if it's been open that long. There's no good excuse for crashing: these problems absolutely should be fixed.
It should be noted, however, that the "session restore" feature in Firefox 2.x reduces the impact of these crashes considerably. If there's an unexpected crash, when you reopen it, you get a dialog that says "Do you want to restore your previous session?" So, you actually don't lose any of your tabs. (Even session-dependent things, like being logged in to Gmail or entering something into a text field are restored, if memory serves.) So a crash is functionally identical to a 2-second freeze.
Again, I emphasize that the crashing should be fixed. I'm not excusing the bugs. However, it's nice to see that they have at least coded it such that when it fails, it fails somewhat "gracefully."
The truth is that as fine a product as FireFox is, it's "ownership" has issues with criticism from the hoi polloi. The reason this is an issue is that FireFox sells itself as a browser for the masses, not just a "leet" geek toy. Therefore, one would expect the FireFox leadership to be responsive to the issues that the "masses" have with FireFox. This has been an issue in the past.
If you want news from today, you have to come back tomorrow.
IIRC, "there are no leaks in firefox, it is your extensions causing the problems".
Today, FF has morphed in to something which can't be used, with plugins, for more than a couple days max without needing to be reset.
You say that, and you compare it to IE. The only environment where I know people keep a firefox process open for days is on the mac, which doesn't run IE anymore (and btw, safari 2 leaks like a sieve too in my experience). Yes, I have to relaunch ff on my mac every few days. But on windows every time I close my last window, the browser shuts down and all memory is reclaimed. So, on platforms that are not mac, and for "normal" use patterns (i.e. don't leave a browser window with sites open for days), this is a non-issue.
Thiis page may be informative about the issue of memory in firefox: http://plugindoc.mozdev.org/faqs/memusage.html
Yes, I sure hope that I won't have to deal with massive memory usage anymore: http://moore.cx/images/firefox.png
The biggest memory leak does not show up in firefox itself. It shows up in the X process:
:0 -auth /home/me/.serverauth.30245
TIME+ PID USER CODE VIRT SWAP RES SHR S %CPU %MEM P COMMAND
391:42.00 30262 root 1712 864m 481m 383m 5636 R 20.5 38.0 0 X
19:54.97 5473 me 9.9m 350m 202m 148m 18m S 0.0 14.7 0 firefox/firefox-bin
xrestop shows this:
res-base Wins GCs Fnts Pxms Misc Pxm mem Other Total PID Identifier
3600000 295 62 1 2664 119 621592K 12K 621604K ? Firefox Working to Fix Memory Leaks - Mozilla Firefox
In other words, X has over 600MB of memory holding pixmaps for firefox. This grows every time I open a page/tab with images in it.
Closing pages/tabs does not free the memory from X, nor does lowering firefox's various cache settings in the preferences dialog and about:config. Quiting firefox causes X to release the memory. I have to do this at least once a week.
What people call the memory gobbling bug is actually also a CPU hogging bug, and it is still present in Firefox version 2.0.0.7, even though the bug was reported perhaps 5 years ago. Versions 2.0.0.7 and 2.0.0.6 are far more stable than previous versions, but Firefox is still the most unstable program in common use.
The CPU hogging bug in Firefox may be caused by inadequate allocation of resources. Maybe the chaining of the event handler code with numerous windows open is an issue.
Firefox crashes Microsoft Windows. Apparently there is a bug in Windows, or more than one, that causes the entire Microsoft Windows OS to become unstable when Firefox starts CPU hogging. In any case, the only way to get Windows back to a stable state after killing Firefox is to re-start the computer.
It's interesting that Firefox can be used to show that Windows is an unstable OS, in some cases. Linux is completely stable; it is only necessary to kill Firefox to regain resources.
The Firefox CPU hogging bug occurs only during heavy use of Firefox, with many Windows and tabs open for several hours, such as happens when someone in purchasing in a corporate environment is researching computer parts. The problem is made worse if the computer is hibernated or put in standby.
If you open a lot of windows and tabs in Firefox on a laptop, and put the laptop in and out of standby, you will eventually notice that the laptop fan is running all the time, even when there is no activity. That's the CPU bug, and it can potentially shorten the life of your laptop. The fan is often the laptop component that fails first.
It is interesting to note that the latest version of Opera also exhibits CPU hogging, but much less frequently. However, using Opera is not as comfortable because of poor design decisions in Opera.
See: Firefox is the most unstable program in common use.
Firefox developers apparently game the system by abusing those who report bugs: Mozilla Foundation Top 20 Excuses for Not Fixing Firefox Bugs.
Firefox development sometimes resembles playing.
Basically, this seems to be the underlying problem: Winifred Mitchell Baker, the CEO of Mozilla, is a socially uncomfortable lawyer who became CEO when no one thought there was an opportunity. Now Mozilla Foundation is making millions from designating Google as the default search engine.
Winifred has insufficient control over those who work for her, because she doesn't understand what they do. The Firefox CPU hogging and memory gobbling bug would take some serious troubleshooting to find, and no one wants to do the work, apparently.
So have they finally acknowledged that Firefox is a memory hog instead of just blaming users for not understanding features? I can't believe how much memory Firefox uses just from the start. The memory buffers use up 3/4 of my memory with an empty, just launched, instance of Firefox. Where does all that go? Sure buffers can be cleared if needed, but I'd rather have that memory free (which I'm guessing can be allocated more easily than buffered memory, but maybe I'm wrong). Either way, I'd like to know why it spent time allocating buffer memory without even a single page loaded.
How about making at least the Javascript engine and the Flash plugin framework multi-threaded?
IE has been lowering the CPU priority of Flash applets for years so if you have 100 Flash ads open, it won't bog down your browsing. On Firefox, try opening a couple of tabs in Yahoo and it basically grinds to a halt.
It used to be that in NS4, I could see "nsplugin" process so I can renice that to achieve the same effect. On Firefox, it's not possible.
And, if you happen to leave Gmail open, my CPU usage (lowly Sempron) will hike to 30% twice a minute. On IE the CPU usage stays low. I suspect it's due to a multi-threaded Javascript engine in which individual thread can be prioritized.
Must be something else. I run Firefox 2.0.0.7 under Windows 2000 on a ~500MHz laptop w/ 160MB of memory, and it doesn't ever lock up on me. No, it's not fast, but it's quite stable and usable (in spite of the 800x600 max resolution). Something else is likely the cause of your instability, like a plug-in or using a later version of Windows.
Method of processing duck feet
Agree! And you know what was even more irritating than the official leadership denying this? The dozen Slashbots who would automatically throw themselves sacrificially onto the incoming path of your criticism, saying, "There's no memory leak! Firefox is just reserving 3GB of memory to
cache all your huge web pages! Like that bloated Google main page!"
And now Mozilla is saying, "You know that memory leak that didn't exist? Well, we're fixing it now." Did someone take lessons in Microsoft Marketspeak?
Here's something else they should stop denying: the fact that Firefox is frick'n bloated. It needs to be pared down to a skeletal size, and everything moved to an official series plug-ins/extensions/add-ons (or whatever they're called these days) that can be installed by default, but which can be removed to get the desired responsiveness and small memory footprint. But when Chris Beard of Mozilla was interviewed on Slashdot, he said:Yeah, buddy, that's because all your extensions are an integral inseparable part of Firefox. You're just afraid of the complexity of testing and debugging extensions, aren't you?
I still use Firefox. I still use unsigned extensions because that seems to be the standard, and for some extensions there just aren't any signatures. That's because Firefox has Adblock Plus and NoScript. The minute these appear in Konqueror, I'm saying goodbye to Firefox.
404555974007725459910684486621289147856453481154 in hex is "You sank my Battleship?"
[GPG key in journal]
I think it's called Firefeature, though.
Sometimes the sociology of Firefox bugs is more interesting than the bug itself.
The parent comment has been marked Troll and Flamebait. (Numerous other Slashdot comments discussing the same CPU and memory hogging bug have been marked +5.)
Why so much denial?
A well-written C++ program is going to free memory much faster than a GC can. The value of GC is that you don't have to worry about forgetting to free memory, it will happen - eventually.
Real programmers can code memory leaks in any programming language.
:-)
(I'm not kidding, it is very easy to accidentally use a strong pointer, where a weak pointer should have been used. Especially in languages that doesn't support the later concept
I know this is not code level, technical, observation but a real world comparison. I use 4, 22in LCDs in my real estate office window to advertise houses. The web page they display is javascript light, one to change the logo every 30 seconds. Each page has FLIKR applet to show a slide show of the property. The 4 firefox browsers will grind the system to a halt within 3 days (P4 630mb of RAM). The same 4 pages shown continously in IE7 will last 8-10 days. Either way it is crap b/c they should not leak at all, they are web browsers with thousands of peole wokring on them. Increased quality review and assurance of core functionality would probably help here. Thankfully memory is so cheap I am bumping up to 3gb. Not to go quicker but to last longer between re-boots...
If I had mod points, you'd get a funny!
Are the moderators asleep today?
> (so much for the "millions of pairs of eyes" thing, huh?)
The story is about how many leaks have been found and fixed. How do you see that as a bad thing? Or do you mean that with open source development model, these bugs shouldn't been there in the first place? Well, Firefox is based on Mozilla Application Suite, which is based on Netscape Communicator, which was developed as closed source application, before it's source was released in 1998.
http://en.wikipedia.org/wiki/Mozilla_Application_Suite
> Actually, the big language culprits would be those with auto-garbage collection,
> etc. as they tend to have lazier programmers
Actually, it isn't lazier programmers. The problem is that existing garbage collection implementations have horrible memory profile.
If you look at the memory usage of a java program, it's about as bad as a c program that does nothing but leak memory. Practically speaking, java does little to free memory until it has *run out of memory*. Then when it does run out of memory and it needs to clean things up, things get slow as hell.
>The real answer is doing your job right, and using the right tool - which is not necessarily
>the easiest tool to use either.
Yes! Unfortunately, academics and many novice programmers (who just got finished being trained by academics) are unfamiliar with the powerful tools available like C++. Going to school can give you the mistaken impression that garbage collection is *a good thing* because everyone uses it there. The truth is that C++ is a very complicated language with a steep learning curve, but that many times it is simply the only tool that is suitable for the job.
If your program is IO bound, like a web application front end, you are in a great position, because essentially *any* tool will do the job, even if the performance is abysmal. You can use java, ruby, or whatever. And you should, becuase those languages don't present you with the complexity of c++.
Unfortunately, many programs *are not IO bound* and the performance and memory profile of the underlying tool are very important. This is most true of interactive non parializable programs. So, a good example would be bittorrent programs. Consider utorrent vs azureas, one in c++ and one in java. utorrent is fairly light weight and easy to use because of its performance characteristics. Azureus is a powerful and well engineered program, but it sure as hell is slow and chews up memory.
Add some threaded (or better threaded) support... I'm sick of one tab loading something like a Flickr.com page and while its loading I'm looking at other tabs and unable to scroll up and down the page...
Any type of liquid damage voids my service contract.
It's an act of balance, and the problem is not _always_ "sloppy coding". It is the increasing complexity of these apps, combined with user demands which push the development towards low-level development languages.
A memory leak is a programming error, an implementation failure. Complexity is not an excuse for the existance of errors at the implementation level, because can be easily avoided with proper programming methodology.
It is a shame that we assume that a complex application has to have memory leaks! I am sorry but after 30+ years of programming I cannot accept that kind of statements as being 'realistic', they are just 'sad'.
Users don't create memory leaks, only BAD PROGRAMMERS do.
What's in a sig?
MOD PARENT UP.
See this +5 comment posted below: Firefox's problem is architectural and not one of garbage collection..
Quote: Actually I'm pretty sure they're in denial as to the cause of their problems. Announcing they're working on fixing "memory leaks" just supports their ability to continue their delusion. [my emphasis]
A +4 comment to that comment discusses Firefox's "four separate memory allocation schemes":
"1. Custom malloc/free implementation. (Yes, custom - not from libc.)
2. C++ new/delete operators, which for all I know may be overridden to use their malloc/free.
3. One of the first two with reference counting to decide when to free/delete.
4. JavaScript mark-and-sweep GC.
Dealing with this causes some truly insane hacks..."
Then read the comment they don't want you to see: The memory bug is also a CPU hogging bug. At present, it is marked -1 Flamebait. However, that comment begins to discuss apparent social problems at the Mozilla Foundation, and some of the same material has been marked +5 in the past.
Comment removed based on user account deletion
I'm talking about how Firefox still has leaks today (current version, right now). The damn thing has been out for years, and it's about as leaky as a screen door on a submarine. The OSS model is supposed to help make sure things like this don't happen, or if they do, they're less severe. It's been years, and Firefox still leaks memory and crashes like it's still in development (I've had two crashes in the past 3 hours, already). It's as bad or worse than many closed-source projects. In this particular case, OSS hasn't really proven itself to be more effective than closed source.
I don't respond to AC's.
It's not as user friendly, but you can block ads with the host file. It'll work with any browser, or any program for that matter. http://en.wikipedia.org/wiki/Hosts_file
"A witty saying proves nothing." - Voltaire
Amazing... Last week when the huge gaping security holes in Firefox were discussed, I was heavily modded down for stating that between that and the huge memory leaks in FF, there was absolutely no reason not to just use IE.
The funny thing was... people claimed I was making stuff up about the memory leaks. I guess this one will get modded down from people denying FF has horrid security. And in next week's FF security article, they will deny the memory leaks. And so it goes.
Duh! I can't believe I never thought of that. That's simple enough. Great idea, thanks! Even better, it's OS-wide, so it effects all traffic coming into the PC. Sweet!
Oh well, buh-bye Firefox!
I don't respond to AC's.
"They're not in denial."
Maybe Mozilla people are not in denial about that one technical issue, but they certainly have been about others. See Mozilla Foundation Top 20 Excuses for Not Fixing Firefox Bugs, posted to the story 611 Defects, 71 Vulnerabilities Found In Firefox.
Since that Slashdot story, many many memory leaks have been found in Firefox which have made it much more stable. But Firefox is STILL the most unstable program in common use.
If I can run ff on my 2001 HP laptop,wiht a messed up harddrive with my own install of Windows 2000 on top of Windows ME, ff performance aint the issue.
/.ers reading this can add other features, like builtin support for video (the videolan thing doesn't work very well) ....
worrying about a little performance is a classic geek mistake; people buy features, not performance.
what are features ?
I have poor vision, and Cntrl+ doesnt increase the size of the text in the url window
the poor state of organization of the site where you down load extensions
I'm sure all the non geeky
Or how about better export and save of urls
or
or
remember, people buy features, not performance - if that werent true, how would MS rule the world ?
Really, I don't, on a medium, modest system, 1.5 duron CPU, and up until last month, just half a gig of RAM, went to a whole gig then just because I was putting in a hardware order and a new stick was on sale. I never noticed any big slowdowns or memory hogging, as long as flash was not running. I wonder what the difference is with firefox? I don't use FF so I can't say. I just tried it several times and always went back pretty swiftly to the suite browser (which can be run standalone, you don't need to do the whole suite with email and chat, you can download and install *just* the browser so it is comparable to just the firefox browser). I find the seamonkey browser to render better, load pages faster, and has a much better set of normal preferences (traditional netscape), and various extensions and add ons are avaialble for it as well. Plus, one big URL bar and small search and go buttons, not two cramped tiny URL and Search bars like in FF, that's pretty dumb really and a lame way to use screenestate. I know they both "share" gecko, but there has to be a reason for this discrepancy I am seeing (linux OS, not windows, for accuracy sake). and ya, I load up the tabs and keep it running, frequently might have three dozen tabs open at any one time. So...howcome FF "leaks" for all these people and seamonkey is so much better for me? I am not a coder so can't really look at anything, just reporting my anecdeotal.
Trying to pretend this isn't a Firefox problem when it's the only application that cause this problem for me and a lot of other people won't work.
Won't the number of memory leaks in Mozilla increase in Mozilla when Tamarin/MMgc is introduced due to the number of false positives? Anyone know why they aren't using a precise garbage collector?
No, he's pretending it's a "Windoze" problem.
Why is closing your browser daily, a "normal" use? In my experience, the ratio of closers/noclosers is closer to 50/50. Anyway, memory hogging hasn't bugged me that much lately, my firefox sessions are usually open for days without problems (only have adblock and flashblock). :)
What bugs me much more is that I can't start a parallel firefox process for opening risky stuff in - you just get another window in the same process, and that one takes the original window down with it when the sh*t hits the fan. I guess the reasons for having it in the same process have mostly to do with it being too much hassle to synchronize multiple processes. Just don't think it's a good reason. If anyone thinks different, please yell - don't downmod
My experience has been quite counter to many of the complaining posts I have read. I now have nearly no lockups that I can ascribe to Firefox 2.0.x whereas it was very obvious that version 1.5 ate memory and at times locked a session. At last count I had 164 tabs open and it is likely nearer to 180 at the moment. At most times I have at least three sessions running email (Thunderbird), browser, coding with Subversion with several files open and in the last a connection to a remote server. If anything my system is much more reliable with 2.0 over 1.5.
I used to be a casual tester for both versions 1.5 and 2.0 and I switched to each well prior to their offical release. What I noticed was much more effort was expended creating satisfactory working versions on Windows over either the Mac or Linux. Nonetheless, I have been pleased with the results. My use of the coming version 3.0 has been very limited running of most of the stable alpha versions. So far my limited exposure seems to see an improvement over 2.0. Another factor that could make my experience worse, is that I use the Mozilla version that I install by hand. I have long ago not bothered to even update the supplied distribution version. Nonetheless, I have no complaints.
Another factor that should degrade my experience, is my machine's inners are not of that recent vitage having only one Gig of RAM and a much older AMD CPU. Might some of the problems so vociferously expressed here be due to other factors than so loudly proclaimed?
I am well aware that supposedly identical machines, with the same software can behave very differently. Had that experience with corporate property using NT and XP, where I could get to Unix and the version control system while a neighbor could not. Nonetheless, I find it odd that my experience is so at odds with the many that have written.
As a community service, I'm posting this list I made. When someone wants to use one of the excuses, they can just give the excuse number. That will save typing.
Mozilla Foundation Top 20 Excuses for Not Fixing the Firefox Memory and CPU Hogging bugs.
Google Talk works in Opera.
I've forgiven them time and time again for screwing up.
First it was the MNG/JNG farce - you have to see this for yourself to believe it. 5 years (!!) of making up bullshit excuses later they dump an inferior, crippled "replacement" format in the browser to force everyone to give up.
I won't comment on their side project to make a faster, smaller, less bloated browser... you can all see what a success that's been.
Now for some reason despite all the times the mozilla people have done this -- much more than the two examples I've mentioned -- I was still using Firefox last month. Then it broke spectacularly on me (which was to be expected given it was a CVS build), so I load 2.0 up again and I realise half the extensions I have installed in it are to fix bugs and security holes it shouldn't have in the first place. I can name Noscript and Long Titles off the top of my head. I realised there was no reason to keep using this crap just like there was no reason to keep using windows.
Memory leaks aren't Firefox's biggest problem -- it's the inmates running the asylum that is. Until that's fixed, I'll be using Konqueror. (if you want to know why I won't use opera, substitute developers for users)
Excuse my ignorance, but isn't there a huge difference between {removing a frame from the stack && explicit object destruction} and {garbage collection}?
Garbage collection is usually defined as automatic object destruction when there are no more pointers to it within the application. C++ doesn't do that. It can't, without taking a performance hit and taking control away from the programmer. This is not to say that garbage collection is evil (I use python regularly), only that I seriously doubt your claim to a garbage collector in gcc compiled programs. If there is one, it is probably a different definition than normal for garbage collection.
I won't join Slashcott. OTOH, If Beta goes live, I just won't be back until it's fixed. Sorry Dice.
I've found that the Linux version (running in Gnome on RedHat 9) starts consuming ungodly amounts of processor time for minor tasks--even taking 1-2 seconds to respond to buffered keypresses in a slashdot comment textarea--if it has been allowed to run for more than 24 hours. It feels like the same time every day when I have to kill -9 the process and restart it. The only exception seems to be it is able to survive a weekend of non-use. Even vs. odd days?
Oh, say does that Star-Spangled Banner entwine / The myrtle of Venus with Bacchus's vine?
Daily reboots are a Windows problem, not FF
You do realise that he's talking about restarting FF not rebooting Windows, don't you?
I've got a real clunker of a laptop, 256 MB RAM PIII, that runs FF with Flash and all that
Congratulations. I regularly see FF hit in excess of 200MB of RAM usage after a few days of normal usage. This instance has been running maybe 20 minutes (after locking up earlier) and is using 65MB already.
It's official. Most of you are morons.
Actually at least with the Windows version, I haven't noticed much of a problem with memory leaks personally. I guess that's probably because I finish whatever I'm doing and tend to close all my FF windows at least once every few hours though. Anything to fix bugs and lower resource usage is always a step in the right direction though, so I'd have to applaud this action regardless.
Although Firefox does have some issues with memory usage (and occasionally memory leaks), that doesn't seem the be the primary cause of usability issues.
In my personal experience with Firefox, I see two problems:
Both of these problems could be solved relatively easily with threads (in a number of different ways), but for some reason the Firefox developers have an irrational paranoia of anything that even vaguely resembles native concurrency. They say "the real problem is just response time, if we can respond fast enough in a single thread it's the same" - but then they never actually do it, and they definitely don't do anything that would let them recover from component crashes.
-- The act of censorship is always worse than whatever is being censored. Always.
I've really been annoyed by this, but I'm addicted to both adblock and mouse gestures. Would downgrading to firefox 1.x be a solution? I don't even remember if things where better then?
Dare I say, It's about damn time. I've been fighting FireFox memory issues since I first started with Phoenix. Mozilla was never this bad. I rebooted at noon because Firefox was just under 800MB. I've been on the phone and/or away from my desk for 2 of the 4 hours since I rebooted. FireFox is already using 258MB. I love the Fox but this is screwed up.
A lot of problems would be solved if graphics designers were forced to use 15 inch screens and programmers would have to use 500Mhz machines with 256MB memory.
Unfortunately many programmers and graphics designers have to have the latest machines with the highest specs - the result in many cases are websites and programs which are too slow on lower-end machies.
That is at least the conclusion I had to draw when I auctioned off the remains of one defunct web design company.
I cannot help myself but comment the statement where you claim that "Simplest solutions are often the most inefficient ones". I know what you mean, and agree, if the amounts of items you are about to manipulate justify choosing the more complex algorithm. I am taking the sentence somewhat out of context, I am aware of that. And I do apologize for doing so.
:)
However, in my experience, the opposite, generally, is true. You do know the KISS principle. The most important thing - of course - is to really understand the problem area thoroughly, and choose the Right solution rather than the fanciest. If a fancier solution is not clearly justified over the simpler one, mostly erring to the side of simplicity yields code that is easier to code, understand, maintain - and on the occasion it needs to be done - refactor.
I would say, from my personal experience, that choosing a solution that fits the problem is very often the simpler rather then the more complex one. Of course, context really settles it, but simplicity is just pure gold, as we're all too bad at programming in the first place. Humans just generally suck at it big time.
That all said, I do most of my coding in C/C++, but I don't shy away from e.g. Python to use it to do a job that it fits well. However, guestimating, it's probably a bad idea to use a big mix of languages in a big project, unless the areas are very well defined. Also, the problem w/many high-level-libraries is that you become entirely clueless to what's happening under the hood, and that can lead you to do very bad choices. So being a bit picky about what libraries to use can be a good choice, indeed. And in the least getting to know what they do, a bit, too. Of course premature optimization is kind of bad, but then again it most often isn't the simplest way either.
All in all, I'm a big believer in the KISS principle, and I tend to think that there's a lot of good reason to be that, too. So choose that array over more sophisticated algorithms, if there is no doubt that you won't have many items anyways. Change it to something fancier, when there is reason to, unless you can see from the beginning that there will be loads of items to deal w/.
Sometimes I feel like people are using more complex algorithms just for the coolness factor. That simply just isn't good design.
If you're about to code the algorithm yourself, by all means - do that as an exercise - to learn ! - and then toss it, and use the array, to remove all the bugs that your own implementation of a complex algorithm would bring about unnecessarily.
The lyf so short, the craft so long to lerne
One of the highest ignorance to knowledge ratios in Slashdot's history...
90%+ of the c/c++ guys have no clue.
99%+ of those bagging on GC have less of a clue.
They might as well be talking about girls...
Geez.
Perhaps the culprit is C++. Languages with auto-garbage-collection or are database-engine-based tend to clean up automatically or cache to disk more effectively. C/C++ just seems to have so many low-level crevices to accidently mess up with.
...) which does so. If this occurs in the base class of a derived class with member variables which are pointers, the latter aren't initialized and contain leftover heap or stack junk. So the garbage collector can go awry and get totally lost.
Like C, C++ gives you more than enough rope to hang yourself.
C++ has four memory models for object instances:
- Global/static: (permanent one-per-program instances).
- Stack/locally scoped: (local variables of class type in functions/subroutines or limited scope (between curly-brackets) within them.
- Member/class scoped: (non-static variables of class type which are members of another class.)
- Heap/dynamic: (created with "new" and released with "delete")
The programming model for management of dynamic memory is algorithmic: The programmer is expected to keep track of when objects are no longer reachable and free them.
C++ provides enough hooks to construct reference-counting smartpointers that can delete dynamic instances when their refcounts go to zero. But reference counting isn't a general solution: A set of mutually-referencing objects can become disconnected. They can no longer be reached and should be freed. But each references another, so their reference counts are non-zero and they persist. This is why garbage collection requires full-blown forest-walks (or incremental partitions of them) to reliably avoid memory leaks.
Unfortunately, C++ has a subtle bug in the specification (and standards) that prevents building a general garbage collection system within it (even with preprocessor assistance).
The problem is that garbage collection is one of the ways that an external routine can (properly) call a virtual member function (or do the equivalent) on an object that is midway through its construction or destruction and absolutely must get the correct version of the function for the stage of construction in question.
This occurs because an object can have pointers to heap-allocated ("dynamic") objects as variables at multiple levels of inheritance. To build in a garbage collector your objects need a way for the collector to identify their pointers and follow them. Anything that allocates memory may provoke it do to this as a side-effect, and routines called during construction (or destruction) may allocate memory, or call something (that calls something that calls something
To avoid this you build heap-allocated objects (and those which point to them) so that they contain a virtual function that enumerates the pointers in its own level (and those more baseward) and override this as you proceed through the stages of construction, so the pointers at each level are enumerated only IF they have been initialized. (There are constructs other than garbage collection with similar issues, and for some of them the issues are also significant on destruction, as various levels are finalized and their virtual functions would no longer perform correctly.)
C++ actually gets this correct during the execution of the objects' own constructors and destructors themselves. (Other OOP languages, such as Smalltalk and Objective C, don't. Smalltalk gives you the "subclass" version during the construction of all the levels of "superclasses" - thus breaking the debugging of the superclasses whenever you override a method that is used in a constructor. It gets away with garbage collection because it's built-in and handled separately.)
Unfortunately, member variables of object type also have construction and destruction, which might provoke garbage collection (or what-have-you) as a side-effect. During the construction of members you're guaranteed to have times when other members are not yet initialized - which ma
Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
Yeah, I had used opera every now and then earlier but then Ubuntu where retarded enough to stick to firefox 1.0.7 instead of 1.5 even thought it leaked memory as hell I where angry enough of it's 1.5GB of allocated memory so I switched to Opera and haven't and probably never will look back .. Opera after 8.52 rocks.
Those are excuses 4 and 12 below.
My view of C++ is that it invokes the necessity of reflection more than any other. The people who hate C++ the most are the same people most invested in convenient solutions, for any x, where convenience == x. For almost any x, C++ is terribly inconvenient language. Which is precisely the reaons that C++ excels at solving terribly inconvenient problems, or it would have no reason to exist in the first place.
Due to the exponential nature of computing power increases, at any given time about one third of the surface area of the problems people are most highly motivated to solve are terribly inconvenient problems: the original open-ended evolution of HTML, the recent transition to Web 2.0, scaling a search engine to 500,000 compute nodes, navigating a Mars rover.
Resource management has earned a reputation as being a hard problem only because so many people are bad at it. If you can't correctly manage memory in C++, it's pretty much guaranteed you can't write a sychronization correct multithreaded application.
Most of us have learned to think in terms of preconditions, post-conditions, and invariants for coding a correct iteration that terminates. It's no different to correctly specify object lifetimes in a code base lacking automatic GC. The object comes into existence under this condition, while it exists this invariant is true, when the invariant fails, the object is disposed, and the time between the last two steps is as brief as can be practically arranged (ideally, the distance between two successive program statements).
I suspect Firefox leaks so much because the coders have descended to mechanistic thinking: to do this task we need to allocate this object, later when this mechanism is activated, if it appears correct to do so, the object is disposed. Sweet. We completely bypassed the inconvenient step of specifying a rigorous object lifetime invariant expression. Hurray! The project will ship on schedule.
By contrast, the Java programmer is spared any guilt over bypassing this difficult logical step. Only the GC doesn't entirely save you. If by a logical error, you leave a reference to an object intact that is in fact no longer needed, the GC will never free this object. With any luck, the object maintaining this unnecessary reference will get cleaned up later on, and by implication also its orphans. And there won't be much surface evidence of this missed logical step either, aside from the usual observation that the Java app. is generally consuming far more memory than you would like to believe.
One C++ project I happen to like is the monotone SCM. When you set out to write a rigorous SCM tool, you are committing yourself to a life time of high calorie lunches at the reflection buffet. At this point, C++ is the least of your problems. In fact, I always gravitate toward projects where convenience for its own sake is shuffled out the door on day one. Do you think Google built their massively parallel computational architecture by showing up every day asking themselves first of all "what is most convenient?" No, a challenge on that scale demands a renewed investment in hard thinking after every meal.
I would learn Haskell for the inconvenience it offers, but I already enjoy 90% of the inconvenience that functional programming has to offer by grappling with C++ template instantiations.
To paraphrase Einstein--for those of you who find it tedious and inconvenient to wade through a sustained meditation--your programming language should be as convenient as possible, but never more convenient that the problem your program is attempting to solve.
To update Knuth: premature convenience is the root of all evil.
Your post leaves out some crucial details.
Yes, Netscape Communicator was closed-source, and yes, its source was released in 1998. However, the released source code was so unmanagable that they rewrote the entire thing. Mozilla (renamed later to Mozilla Application Suite) was born from that. It was an interface based on Gecko, the rendering engine.
As for Firefox, it's nothing more than an interface fork from the old Mozilla Application Suite.
It's quite easy to do a C++ garbage collector, actually. I've submitted mine to boost (I am not a very competent C++ programmer, but something needs to be done for the memory problems of large C++ applications).
I'm not sure if it's Vista, or just Firefox getting better after the 2.0.0.6 branch, but I've noticed GB-sized memory consumption/freezing a lot less on Vista than with previous usage on XP. I think the problem actually is being improved somewhat, regardless of what's really fixing it.
Regardless, I find the MozFoundation's attitude toward this evasive, given the magnitude of the problem and how long it has been affecting people's machines. I simply find it irresponsible to write unnecissarily resource-gobbling applications, period. Think how much extra power machines are pulling because of this.
Do not downmod posts "overrated" simply because you disagree with them.
It depends on the application. If you have a few large objects, then manual memory management wins. If you have lots of little small objects, a generational copying collector is a much better proposition.
You should try Java 1.5 sometimes. Allocation of objects is so fast, it's practically equal to using the stack.
If you only have to restart the program, and not your machine, then this may be the single best thing open source has ever done for you.
Think on it. Read the comments from stories more than 8 years old. Then try ditching windows for something more challenging.
One frustrating thing about this is that fixing memory leaks is relatively easy. To have any memory leak is unnecessary and a sign of a mediocre programmer.
To find a memory leak just instrument the memory allocator. See what's left when you exit the program and that's your memory leak.
There are several commercial/freeware packages that will do this or just roll your own. This will catch all memory leaks that aren't caused by memory corruption, including ones created by threads, addons and interpreted code. You can even use it with a garbage collector to see why certain blocks of memory aren't being freed by the collector. It has an overhead but not a major one and on a fast development machine it's easily usable, particularly if you're able to take advantage of a second CPU.
The firefox developers should create a beta build with instrumented memory allocation. Better yet make it part of the standard build (it's small) and enable it with a configuration option. The instrumentation could be made quite sophisticated with arena's, snapshots, tagged allocations and the like but even a basic calling PC log would be a big win.
Memory corruption is a different ballgame. For that you need to do much more sophisticated instrumentation that will catch bounds violations and unallocated pointer access. Possible, but can cause the program to run so much slower that it becomes impractical to do on a large scale. Should still be done occasionally though just to see what obvious, easily fixed violations are occurring.
---
Don't be a programmer-bureaucrat; someone who substitutes marketing buzzwords and software bloat for verifiable improvements.
MOD PARENT UP!!
This is the most educative post in this entire article.
We are Turing O-Machines. The Oracle is out there.
And I've ran Firefox on various SUSE and openSUSE distros, while using a shit load of plugins (Adblock+, Adblock Filterset, Beagle, Dict, Fission, Image Zoom, NoScript, Resurect page, Session manager, Unplug) and browser-plugins (MPlayer, GNUClasspath's Webgcj and Gnash). I've regularly got dozens of opened tabs, of which a significant part is caried over between each sesssion. :
.DLL" plugin eats up memory, the memory is allocated for the firefox process. Once the plugin is finished, its memory stays allocated (because the allocator application - Firefox - isn't closed yet).
And I've almost never encountered any problem at all (with day long sessions). Really. This on a PIII-generation processor with less than 1GB of ram.
The only couple of time I encountered something was
- A Suse package where they forgot to disable the debug-log feature, quickly fixed with a newer package a few days later.
- Using unstable alpha Gnome package sometimes crash on opening certain dialogs. As soon as a I replaced with stable Gnome. Everything was back to normal.
Though, the last few time I tried installing the Easy Gesture plugins (a radial menu gizmo) memory usage completely crapped out. Back to normal by removing the plugin. Thus I'm actually ready to believe that memory hogs are due to some badly behaving plugins. That explains why only some people experience them : only the users with the bad combination of plug-ins have problems.
Also, note that mplayer, webgcj and gnash browser plugins, aren't actually plugins, but thin wrappers that launch player in separate process and integrate the output inside the webpage (just like the mozplugger did back then).
Other browser plugins that are dynamic libraries and thus run inside the same process as firefox. If ".so /
Gnash and MPlayer are separate process. They allocate their own memory and once they finish, the process is closed and everything allocated by it is freed.
I've observed that some flash pages make Gnash process go mad. Hopefully as it's a separate process, it's easy to kill. But means that, had it not been a separated process, it would have been Firefox that would eat 1GB virtual memory). In fact the few couple of time I've tried installing the Macromedia Flash browser plugin, I've experienced massive instabilities (FF freezing when closing tabs and such). Even now when I use the stand-alone player, very often is freezes or jumps its memory usage. Adobe Acrobat was another browser plugins that doesn't behave well (I've never attempted installing it, I've seen enough horror stories on friends' computers).
Thus most memory leaks could be blame to some plugins and very probably to badly behaving closed source browser plugins that run as dynamic libraries in the same process.
That, or there some mysterious anomaly that causes opensuse's firefox packages to behave differently as the rest of firefox installations on other machine.
Saddly that's not technically possible. At least not in a easy way. Because most plugins, both Firefox extensions and browser plugins, run in the same process as Firefox it self. All memory gets allocated by the same process : "firefox-bin".
To be able to distinguish between memory allocated by firefox' core and plugins, what is needed is complex system that uses hooks into the malloc/free procedures (just like valgrind and similar memory debugging tools) and also some kind of "context" variable that gets changed before jumping into and after returning from code in plugins, so the hooked malloc/free can guess whose is the code that allocated
"Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
I bet that she has no firefox extension plugins (the thing that goes inside extension manager), but that she has both adobe/macromedi flash and sun java (and eventually adobe acrobat and realone player) browser plugins installed (the things that go insed about:plugins).
Those are piece of code that plug inside firefox main process too. In fact they are worse because they are dynamic libraries (.dll /
"Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
Seriously. Install flashblock. I was absolutely amazed at how little memory and incredibly stability came out of just "not having every stupid flash ad run". Flashblock lets you selectively run the content you want, and nothing else. While I know Firefox isn't perfect I'm pretty sure 90% of people's complaints about Firefox hogging memory and crashing and becoming unresponsive is actually due to Flash leaking back into the Firefox application.
...towards older men. "Mozilla Firefox. The only browser with more leaks than you with that bad prostate."
If my grammar and spelling are off, I am [distracted/tired/careless] (take your pick)
I run FF on Windows at work. It's not a problem for a day or so (which is quite common for me) but after two or three days it will be using a ton. Just making sure I close all windows once in a while fixes all that.
For everything running under firefox-bin... hooking malloc is exactly what I'd suggest. If they are written in something like JavaScript it shouldn't be that hard to tag allocations. If they are written native then scan them for malloc calls and such and refuse to load. They should call ffmalloc (or whatever you want to call it) and it's (new) friends. That would make keeping track of it rather easy.
I'm not saying this is perfect. I'm not saying it's the world's cleanest idea. But it would give a good idea of what was going on. Using a separate thread for each thing would improve things, but that has tons of problems (especially synchronization, unless you run everything serially one thread chaining to the next, but that's quite hideous).
As for the "when X is doing Y" thing... that's near impossible. With the above in the developer should be able to put some sane warnings on it, but that was mostly a little "think is how I think things should behave" bit, not really something to implement. It was going to be that kind of suggestion, but it got nearly impossible fast.
I've heard the new JS/EMCA engine that they are working on should fix some of that stuff, but that is quite a ways off.
It's OK. Firefox is a great browser. I love Safari on my Mac, but on Windows I'm hooked on FF. Safari is nice, but since Apple loves to re-implement everything it isn't the fastest horse in town. IE is... well... the browser just got tabs last year. It's really hard to debug CSS type issues, and I frankly thing 7 is just plain ugly.
Comment forecast: Bits of genius surrounded by a sea of mediocrity.
There's Opera 9.23 stable and there's Opera 9.5 Beta (codename Kestrel).
Even as Opera is known to be fast and use little memory, Opera 9.5 is faster and uses even less memory, being the best browser I have ever used.
I also use Safari sometimes (to have two gmail accounts open, for example) and I'm in windows. There's no reason to use IE at all.
However, it's still a beta, YMMV, etc.
We are Turing O-Machines. The Oracle is out there.
After reading a fair number of comments, it seems that upwards of 80% of the posts are by people saying "it's not a problem" or "it's a big problem." Another 10% or so seem to be "dude, it's not as easy as you make it sound." There are only a few posts which actually sit down and explain why this can happen.
A small problem with coding is that, these days, the primary first programming language tends to be Java, which shields most novices from the concepts of pointers or memory management. After going into more advanced programming courses involving C (and later x86 assembly), the majority of people hit the wall of comprehending pointers. Our teacher essentially said to not worry about freeing memory--the programs were trivial and the resulting memory leak would be minimal. These same developers later go on and start working on production-level code and start failing to clean up memory--or worse, clean it up haphazardly and dangerously. It takes a fair amount of keeping track of code to actually be able to achieve zero memory leaks (I would be willing to bet that there are several leaks in the Linux kernel).
At this point, I would also like to interject with my experience with Mozilla. I have not worked on FF--the core build library of FF would kill my computer, but I have worked on TB and the calendar portion. My experience with the code is that it needs nothing more than a massive steamroller to destroy the TB portion of the code and rebuild from scratch: it is an export of the old Netscape code built upon with hack after hack and of very poor documentation: TB is very often overshadowed and ignored with respect to FF. The calendar project is even worse: the main cabal there seems to push it to be more and more like Outlook when it is currently in several ways superior.
I would also like to make comments about other points brought up:
1. It is nearly trivial to create a memory leak in Java or with any other modern-day state-of-the-art garbage-collected programming language: just hold on to an object longer than you need to. It is the nature of most instruction that I have seen to actually implicitly encourage this tactic; these memory leaks are more difficult to track down than objects that merely haven't been freed since the reaction tends to be "I might need it later."
2. Multithreading is not the panacea. Try coding serious multithreaded code for a minute and see how well that works. Multithreading GUIs (besides a thread for rendering and maybe a thread for double-buffering and the main thread) is almost an exercise in futility: too many components are interacting and holding each other up. It was pointed out that one thread could be rendering each tab--that is going to be of dubious efficiency since more than two threads is pointless (current tab and background; I don't see quad-cores in the near future and the overhead of context switching can make large number of tabs unusable). Another reason that it could be a bad idea is that having two threads IO on a local disk at the same time is going to increase run time (local IO being one of the best examples of where your CPU is sitting idle; remote IO is even better at that!)
I have many more, but it is getting late, so I think I will end here for now.
"Wow. I think I just scared my self."
The REALLY scary thing at Microsoft is to get to know some "Marketing" people. Hollywood's horror movies are a laugh compared to the horror of at least some of Microsoft Marketing.
I've met Microsoft Marketing people who are zombies, who don't actually contribute anything to Microsoft, but to continue to get paid they have to pretend they do. Every day they wake up and pretend to have a job. And Microsoft pretends that they are useful.
It's that sneaky insanity that is scariest.
That's funny, one the people who repliead to your post about the 20 excuses is actually guilty of using many of them.
This issue always comes up, and it seems the vast majority of the people in this thread are bashing Firefox/Mozilla, but they are ignoring three very crucial points.
1 - The code already has been tested with garbage collectors, Valgrind and the like. Most memory leaks hopefully have already been caught, but they are recommitting themselves to this task.
2 - Mozilla is not responsible for the poor javascript and such prevalent in various extensions written by third parties.
3 - This is the most important part, the massive memory and CPU usage is a feature, not a bug, and can quickly be disabled. Firefox 2 and 3 cache fully rendered versions of pages, so that it is "quicker" when you hit the back button. It doesn't have to rerender the page. Personally, I don't care for this feature, and so I tell Firefox to use less memory.
http://kb.mozillazine.org/Memory_Leak
Google is a powerful tool. Slashdot readers should familiarize themselves with it before crucifying Mozilla.
http://blindscribblings.com - Tasty pop-culture in conceptual fashion.
Good! Now they only have to tackle the startup performance of this beast, and perhaps some day firefox will become the truly lightweight browser it was intended to be since v1.0.
There is a somewhat simple solution for those who have multi-core processors. Limit Firefox to only one of your cores. No matter how much (of that) CPU it uses, Windows itself can still use the other. You could even set Explorer.exe to use only the other core(s), to completely isolate the two. Yes, I realize explorer is not all of windows, but it seems that affinity can't be set on winlogon and other system tasks. :-( This doesn't solve the RAM problem, but it could help with the CPU issue. Also, it's worth noting that Firefox is only using about 100 megabytes of RAM right now for me, by far the most of anything I have open, but nowhere near the 400 megs or so some people have reported.
Holy cow did I learn something from my post that started all this controversy: C/C++ is popular with those who have a lot of mod weight on /. and they are not afraid to use it if you criticize their favorite tool.
Table-ized A.I.
(throws chair!)
/banner.jpg then /sidebar.jpg then /bottom.jpg etc - these hits seemed to be faster, perhaps it's time for something like this to be built into a browser?
In all seriousness though, I want performance from FF, feature wise the latest stable 2.0 releases with the addons I've installed (about 6 iirc) is more than enough for my _current_ needs.
I want to see this application pick up in speed, a lot.
Sure it's fast now but goddamnit people I (you?) want more - I've got 4gb of ram, I've got dual core processors, I've got fast hard disks but still the web isn't fast enough.
I'm not a developer, I'm an enthusiast, take my posts with as much salt as you like but I've found the speed of opening web pages hasn't particularly improved that much in the past 10 years.
Sure the pages are more complex, no denying it, I'm not completely dopey.
We used to open what? 50kb of html / images on dialup 10 years back, now how big is your average page, (I honestly don't know) but based on my bandwidth use, quantity of pages I hit, I think it would surely have to be under 500kb.
See the thing is, I don't find the cache use in any browser clever enough, it just doesn't seem to get hit enough at least that's what I'd theorise.
While I'm at it, the one thing I've found which increased performance massively for me was a small application called 'easy dns' - I believe it's no longer available and either way I can't install it on every machine I browse on, but it was a DNS caching tool, lets you add up to 10 DNS servers, it would chose the best ones AND cache whatever ones it had already opened.
When your browser hits
This may come across like a big whine but honestly, I think FF is fantastic, the features are rich and it works well but hell, let's keep improving, I'd love to see the web truely, amazingly quick.
While I'm on that note, perhaps some performance tips for FF would be in order, anyone got any?
Unfortunately, as talented as the team is, there are limits to the architecture.
There is no such thing as an accurate C++ garbage collector and anyone that says they can write a huge app in C++ and not have a memory leak is just an arrogant ass. Once you mix in Javascript forget it altogether.
Interestingly, this is not only due to the talent of the team in writing C++, but due to the desire to port this thing across platforms.
As slow as it may be compared to C++, Java itself would be a sensible solution, given that the ugly hacks would at least
have some portability and an accurate garbage collector to rely on.
Its called diminishing returns, and every line of code added to Firefox diminishes the returns even more.
Has anyone remarked that these CPU and memory issues have been going on since Netscape?
Firefox was not always so rife this problem. Lately though it does seem to be getting worse.
What C++ moderator gave that a 5?
There is not a single object in a single OO program that can possibly have the correct responsibility for freeing its memory
EXCEPT a garbage collector.
Its nonsense like this which is why any sizable C++ production app will take years to work out its "memory leaks".
And thats the best C++ coders around writing those apps.
So you explain if you want to go off on such a tangent, exactly how an OBJECT or a CLASS knows when all its consumer objects are done with it?
Reference counting at the app level? Almost all C++ apps have some feature like this. And they ALL have memory leaks.
You are up a computer science creek with no paddle my friend. You havent addressed long lived and short lived objects,
Objects exposed by API which have no "open" and "cleanup" methods, transactions, statics, you are just a fool.
And any app you wrote or anyone else ever did in C++ has memory leaks.
Period end of story. Moderators, Please stop ranking C++ purists as insightful when they are spouting on about technological impossibilities.
Large C++ apps ALL have memory leaks. Its a mathematical certainty not a statistic regarding bad coding practices. And there is no solution but an accurate garbage collector which is a technological wonder in and of itself. Java has one.
The only difference between Java programmers and C++ programmers in this issue is that java programmers have THE GOOD SENSE to know they cant and shouldnt bother to write garbage collection routines when they write an app. Especially since computer science has only come up with a few ways to do it by smarter people than them with alot more time on their hands.
In 1.5, leftclick and hold brings up the contextual menu.
In 2.0 and up, you HAVE to hold down a key on the keyboard and right click.
And there is NO preferences option to change it back.
What dipwad thought THAT was a good idea?
Fix the broken usabilty/human interface bits, as well as the memory leaks and then maybe you'll have a decent browser once again.
In the meantime, I'm sticking with 1.5. The FireFox browser that's not broken.
Guaranteed! This comment 100% Anthrax free!
Conservative GC scares the hell out of me too, but it *seems* to work well enough in practice. Still makes me nervous. The Boehm GC leaks like crazy, but something that's mostly-precise, like SBCL's garbage collector, seems to do okay.
Oh, and the linked article seems wrong; SBCL's GC is both conservative and generational.
A poor workaround for this problem is to create another profile for your risky visits. See the "-P" and "-ProfileMAnager" options to firefox. Each profile will run in a separate process.
Or you could create a second user for running another firefox even more safely.
I use Opera on Windows. The UI is pretty damn customisable, and within minutes you can have it doing exactly what you want.
Skins can be downloaded and installed in seconds. And I mean seconds. The main toolbar, the address bar, status bar, etc are all customisable, and you can add, remove and tinker with them and their elements very easily.
Getting a UI that you're not only happy with but that also feels more intuitive to you and that makes you more productive in the long run is very quick and easy to do.
'Out of the box', Opera's default UI is very usable. With a few simple clicks via the installation wizards it can be made more so. And, of course, with a few more minutes spent adjusting things it can be made to feel very personalised.
To be honest, I find it a rather hypocritical (and hilarious) complaint for a Firefox user to make, given that the typical Firefox user will do far more of the same (install, skin, tweak, customise), and on top of that will spend far more of time downloading, installing and customising add-ons, many of which purely play catch-up to core Opera features.
The idea that Opera 'out of the box' is "excessively duanting" compared to Firefox 'out of the box' for casual users is just the funniest thing I've heard in a long time.
"Accept that some days you are the pigeon, and some days you are the statue." - David Brent, Wernham Hogg
You could use AT to schedule a "shutdown -f -r -t 5" once a day, at (e.g.) 01:00 - assuming you're auto-logging in to a session, and your software is set to autostart afterwards.
F_T
Browser caches suck, you're right.
I set up a cacheing proxy (squid) and it's the single biggest improvment to my browsing experience ever. I give it around 6 gigabytes (powers of 2) to play with, in a combination of the file stores and the experimental newer object store (for the bigger crap), and tweaked the expiration times to meet my single-user needs (keep the data for weeks folks). Pages just come up kablam.
The huge number of incidental stupid little bitmaps on sites are all a local socket away.
What's interesting is to look at the performance characterstics of copying 300kb - a few megs of graphics over a local socket vs mmapping it in or whatever. It's a nontrivial additional amount of time to do all those memcpys and context switches. But it beats the HELL out of any browser cache. I don't understand why the browser people can't, in the worst case, just use the guts of a decent http caching proxy. Some of them are open source guys!
-josh
Admittedly, I don't stress it on this 'ere XP box as much as I do on my G5 at home, where my norm is probably four or five windows holding anything up to 50 or 60 tabs between them, and I leave it running all the time. (Or at least, as long as I can until it gets unbearable and I have to take my life in my hands and hope that it doesn't forget all my tabs when I restart!)
What's most annoying with the Mac version, though, is the lack of responsiveness. I don't mind it taking ten seconds or so to open a page; well, I do, but it'd be very bearable if it didn't also completely freeze the GUI for the first half of that, and then react very slowly and jerkily for the rest.
I can't say I like XP, but there at least Firefox is relatively responsive when it's busy. Having the Mac OS X version beachball whenever it does anything is most annoying.
Oh, and while we're talking of Mac Firefox woes, does anyone else find that it won't show Flash unless it doesn't fit on screen? If I scroll down so that the the Flash area goes off the top, even just by a pixel, then it appears fine; but if the whole of the Flash area is visible then it won't redraw properly; often it's completely blank. Could this be a plugin issue, or am I doing something wrong?
Ceterum censeo subscriptionem esse delendam.
Sure, it's easy to load an extension and see "omfg my developer machine is halting to a crawl!?"... But how do you find the source of the leak? I'm honestly asking. In the (I know, I know, it sucks) Java world, I can use nowadays very spiffy profilers. They're not only cute as pink ponnies but they also have options like Find probable culprits for memory leaks, they can be remotely attached (say from another machine on the network, convenient to profile server-side apps runnin on headless systems) and detached from running apps with barely noticeable effect on performance (and the profiling options are only getting better and better with every Java release).
And don't think I didn't spend hours tracking leaks in C or x86 and 680x0 assembly programs. It's just that I'm wondering if those people are not actually wasting lloottss of time using tools that can't compete with what's available today when you use some other technologies.
When was the last time I could remotely connect to a running C app and have many shiny profiling infos appearing instantly? I'm honestly asking... Because when I read TFA and TFS ('S' = "summary") my first thought is: middle age. Honestly.
But I hear ya, Java sucks, the JVM sucks, it can't scale, etc. That's why small companies like FedEx and Google are not using such crap for their most demanding web server and.. Oh, wait!?
It's not 1998 anymore, Windows does not need daily reboots. If you don't know what you're talking about, kindly shut the fuck up.
I'm using the latest build of Firefox 3 (gran paradiso) on Linux right now and it doesn't crash or gets slow anymore like Firefox 2 did when I had more than 20+ tabs open, this version of Gecko also passes the Acid2 test, Firefox 3 will be a great release. Thanks Mozilla developers for all this ;)
I'm just curious what exactly everyone is doing (on Windows I understand Firefox has different problems on Mac) that causes Firefox's memory usage to be a problem on a modern box.
I have a gig of RAM, 256 of which goes right to a VMware instance, run Outlook all day long, usually have photoshop open, and work with Firefox all day long. Multiple tabs, plenty of fun little extensions, Flash, the whole package.
So what clues you into Firefox's memory usage? Does your system start running slowly? Or are you opening Task Manager seeing Firefox is using 200megs and getting angry?
Maybe I have better luck because I shutdown nightly.
-- taking over the world, we are.
So when a company or group of coders say they can't fix their memory bugs, I say bull----. When they say that the parent company doesn't pay for fixed code, that I believe.
So if ten years after a small team of four had a bug and memory-leak free code stack, the fact a browser still leaks like a stuck pig after the hundreds of thousands of hours of code that went into Firefox, then it's obvious where the fault lies.
Especially because if they prioritized that fix, coders like me might actually be interested in contributing again.
...Open Source isn't the only answer -- but it's almost always a better value than the alternatives...
"Sometimes "works for me!" is a valid response..."
I definitely agree that "works for me" can be a valid response. In the case of the Firefox CPU hogging and memory gobbling bug, however, Mozilla developers are routinely saying "works for me" without duplicating the conditions under which Firefox fails, or even reading the reports carefully.
Why? I don't know, but I have theories. The politics inside Mozilla Foundation, which now takes in $50 million each year because of making Google the default search engine, seems to somehow favor those who work on the easier bugs to fix. This makes sense, since the chief of Mozilla is a woman with no knowledge or interest in technical things. (See my earlier comment for links.) There can be no effective supervision because the top executive cannot understand even the simplest social issues surrounding Mozilla Foundation software development.
There is a huge variation in Firefox use between users. Most users apparently finish with one issue before they go to the next. Some, however, are extremely heavy users. For example, a computer parts buyer for a corporation that builds computers may need to keep an issue open until he or she gets from answers somewhere else. It is those users, who keep many windows and tabs open for days, with numerous hibernations, who experience the worst memory gobbling and CPU hogging.
There are other contributing factors. People who work especially fast seem to have more problems. Those who have more than one Mozilla program open, for example Thunderbird and Firefox, sometimes see that the CPU hogging bug is shared between Mozilla programs, so that, as many windows and tabs are open in Firefox, Thunderbird begins hogging the CPU! And that tends to corrupt Windows XP; although Windows XP will still operate somewhat after all Mozilla programs are closed, some OS operations will be quirky or inoperative. The only way I've found to return to normal Windows XP operation is to re-start the computer.
As I type this, Firefox is using up to 29 percent of the CPU, sometimes peaking at over 60, with no Firefox activity, since I am typing into an editor. So, later I face the need to close all my Firefox windows and tabs, even though I am not finished with some issues.
Truth is like the sun. You can shut it out for a time, but it ain't goin' away. - Elvis Presley (source: imdb.com)
Actually, there is a preference.
No professional computer programmer should have to worry about garbage collection. This can be automated, which means it should. Not doing so means that sooner or later, you'll end up with memory leaks.
You should understand what it's about, but that doesn't mean you have to do it all by hand. Programming without some smart garbage collection system is like flying an aeroplane and refusing to use the autopilot. It's asking for trouble.
Memory allocated to a program is not released until the program terminates. Unused memory gets swapped out to disk if needed, but still counts in things like ps and top.
Garbage collectors are imperfect and consume resources; there are times when it's better to avoid them. Just as there are times, few and far between, but they do exist, where writing it in assembly is the right thing to do. Certainly writing the whole of a web browser in a language without garbage collection is an exercise in stupidity - things like the bookmark manager don't need performance (except possibly in the actual drawing, but they're using a library for that, or should be), but I would find it entirely plausible that the core of the rendering engine is best done in C.
I am trolling
I will soon try the iFox Smooth theme with the Windows version of Firefox.
Wow. HTF did this get mod points?? Guys says straight up he's talking out of his ass, and it gets Insightful??
1) Mac user. WTF was that tacked on comment at the end for? reality check : Mac users know what's up, which is why they use Macs. I know perfectly well what happens when I close a window.
2) And news for you, when you close a window on any platform, it releases the object resources held by that part of the application, whether or not you quit the application. And on Windows, quitting IE by closing a window also doesn't take IE out of memory, Windows caches it to make IE's startup look fast.
3) It's as valid to say that many people don't realize that if they push the power button on the computer, it doesn't actually turn it off. On many laptops, this invokes Standby or Hibernate, which doesn't clean anything up in memory.
4) My wife works in a bank. Nobody, and I mean nobody, turns off a computer. They log out, and there the computer sits, running Windows. So your "general users" are apparently "general users who turn their computers off at the end of the day"; who, I agree, most likely turn their computer off at the end of the day.
So on-topic, I do work in the tech industry, usually have my OS X laptop at around two weeks of uptime, and happily run Firefox 2 with a NoScript and AdBlock for days on end with no crashes. It does leak, and when I decide the system needs the memory I restart, which is the work of all of maybe 15 seconds.
Yes you can ALWAYS collect the trash when you know exactly how things are consumed and you have ALOT of time on your hands.
Thats called application or API specific garbage collection. The reason it doesnt work
is that any decent OO program will not be concerned with tracking client usage
because object lifetime is largely out of the scope of OO programming...in its ideal state.
So for A PARTICULAR application sure you can CLEAN UP the memory leaks.
But once you use those objects again in a different context, the leaks will be different,
so you will have to write DIFFERENT application specific garbage collection.
Thats why you are better off not doing it at all. In java for example, do you know what the biggest resource issues are?
NATIVE CODE, database connections and the like.
Of course they can be cleaned up. But its native code forcing all that to happen because native code must concern itself
with all these irrelevant things. Having an Object called a garbage collector that deals with it is the most OO thing
you could think of.
Anything that doesnt use one is simply not OO. As evidence of what Im saying, point to any new or recent languages
that DO NOT have some form of garbage collector. malloc and free are history man.
Would have modded you up if I could :-)
:-)
:-)
I did not attend the conference in question. My only trip to the US was to Denver this summer, where I attended the MS WPC.
If you have a name or two I can do a LinkedIn search?
I'll throw you a mail with the same answer
- Jesper
My security clearance is so high I have to kill myself if I remember I have it...