Catch up on stories from the past week (and beyond) at the Slashdot story archive


Forgot your password?
Firefox Bug Mozilla Software News

Notes On Reducing Firefox's Memory Consumption 297

Skuto writes "At yesterdays Browser miniconference in Ballarat, Australia, Mozilla engineer Nicholas Nethercote gave a detailed presentation about the history of Firefox's memory consumption. The 37 slides-with-notes explain in gritty detail what caused Firefox 4's memory usage to be higher than expected, how many leaks and accidental memory use bugs were tracked down with Valgrind plugins, as well as the pitfalls of common memory allocation strategies. Current work is now focused on reducing the memory usage of popular add-ons such as AdBlock, GreaseMonkey and Firebug. Required reading for people working on large software projects, or those who missed that Firefox is now one of the most memory-efficient browsers in heavy usage."
This discussion has been archived. No new comments can be posted.

Notes On Reducing Firefox's Memory Consumption

Comments Filter:
  • by Anonymous Coward on Tuesday January 17, 2012 @10:09AM (#38723876)

    I have 8gb of memory on my main computer. I want firefox to use up as much of it as it can to improve my browsing experience. On my netbook, I have 1, I want it to sip as little as it can. There should be an easy way to tell the browser how much memory I want used for certain tasks such as caching and whatnot. Addons should have their own seperate allocation, and each individual addon should be configurable for how much memory it can use.

    Free / Open source software is about choices to run things how you want to. With that said, I don't have much room to complain because I've never contributed code to FF.

    My main point though, is that screaming "THE RAM USAGE IS TOO HIGH" is not effective. I have a lot of ram, and I want it to be used, just not wasted; and I want more control over it.

  • Firefox's problem (Score:5, Insightful)

    by TheLink ( 130905 ) on Tuesday January 17, 2012 @10:09AM (#38723884) Journal
    In my experience Firefox (minus plugins etc) has leaked/used less memory than Google Chrome.

    BUT, when a plugin/page starts leaking lots of memory the difference is with Google Chrome you can close the offending tab/window and the memory is freed up. You don't lose your sessions, don't lose your place on other tabs/windows. You can even reopen the page (esp if the page just slowly uses more and more memory).

    In contrast with Firefox you often have to close the entire browser to free up the memory. And IMO that's Firefox's biggest problem when it comes to memory.

    It doesn't matter how much better Firefox is on its own at memory management, in practice many people using Firefox are using it because of the plugins (otherwise they'd be using some other browser), and the plugin developers may not be so good at memory management.
  • by stms ( 1132653 ) on Tuesday January 17, 2012 @10:12AM (#38723910)

    I use firefox because my plugins make the web a much nicer place to be.

  • by Anonymous Coward on Tuesday January 17, 2012 @10:22AM (#38724008)

    Yeah, most of the improvements were in the last 4-6 months.

    Anyone else get tired of this... "blah blah, my favourite open source browser wasn't competitive with the commercial product by an ad agency that records every keystroke I type in the URL bar a long time ago, possibly due to some addons I was running, so I just completely gave up on it and whenever a story comes up on how it has improved, I just state how it sucked at some time in the past and I'll never try it again"?

  • by dkf ( 304284 ) <> on Tuesday January 17, 2012 @10:31AM (#38724162) Homepage

    I have 8gb of memory on my main computer. I want firefox to use up as much of it as it can to improve my browsing experience.

    No, it shouldn't use any more memory than it needs. Using extra RAM just for giggles is stupid and totally wasteful, especially as the rest of that space could be used for something else. What would that other thing be? I dunno. Maybe an email client, an office suite, an IDE, a photo or video editing suite, or something else. Or even many of them at once. But having to only browse the web because doing anything else is painful... that's just wrong, and it's been wrong for as long as there's been web browsers.

  • by guidryp ( 702488 ) on Tuesday January 17, 2012 @10:40AM (#38724258)

    I use FF because it is much more configurable (about:config has entries for more than any other browser), it also has more plug ins, and those plug ins it does have tend to be more effective for just about everything.

    I also don't like Google Chrome calling home all the time (uninstalled). I also have IE9 and Opera installed.

    Speed issues are moot outside of benchmarks these days (unless you are running IE7 on a netbook). IMO it is pure placebo effect to say one browser is faster than another in regular browsing on a modern computer.

  • by 0123456 ( 636235 ) on Tuesday January 17, 2012 @11:03AM (#38724624)

    No, it shouldn't use any more memory than it needs.

    How much memory does it need? I'd much rather that it cached recent pages in RAM than on disk or not at all.

    250MB is nothing on a modern PC with many gigabytes of RAM. My laptop has 6GB, and logged into Gnome with Firefox and another app running the OS is using a whole 900MB, only about half of which is being used by applications. Why not do something useful with the rest of the RAM?

  • by TheRaven64 ( 641858 ) on Tuesday January 17, 2012 @11:30AM (#38725014) Journal
    I don't see your on-topic post. I see an article about software engineering techniques used to reduce memory consumption, with FireFox used as a case study. You then post about how FireFox protects your privacy. This is about as on-topic as a post saying that you use Android because you prefer the user interface in an article about a new feature in the Linux kernel improving battery life on ARM.
  • by Seumas ( 6865 ) on Tuesday January 17, 2012 @11:33AM (#38725050)

    I have a lot of RAM, too. And Firefox runs like shit. It has for years and I've constantly heard the response of "no, you don't understand! it's just how it handles its back button function! That's why it uses two or three gigabytes!". I have 16gb on my primary system, so it can certainly use a few gigs if it really wants to. The question is - does it need to? More importantly, how does it perform when it's using so much RAM? That is the real problem.

    For years, I have put up with the experience of Firefox slowly grinding to a crawl. Within hours (certainly within a day at the most), it reaches 2.5gb or more memory usage and becomes unusable. Almost every action - typing, scrolling, clicking a button, entering a URL, clicking a link - causes it to hang temporarily. Sometimes for almost a minute. Click a tab. Hang. Scroll to the bottom of the page. Hang. Type in the text box. Hang. Submit. Hang. Close tab. Hang. Terrible experience.

    And, I stuck with it. Restarting the browser every few hours just became part of the experience (starting around early 3x, I believe). I primarily stuck with it, because I love Firefox and have used it forever. And Mozilla before that. And Netscape before that. Part of that is that I cut my teeth as an engineer at Netscape when I was young. It was my first real job. So I had a particular affinity for it, always. Besides, eventually they'd fix the issues. Even though they went forever claiming there weren't any memory issues . . . until sometime recently (last year, I think?) when there finally seemed to be acknowledgement of it.

    Most of all, I like having the access to extensions. Primarily, adblocking extensions. And then the tree tabs extension. And then panorama/tab candy was built into 4x. I tried Chrome several times, but their shitty handling of many tabs was terrible. I couldn't tolerate it. Firefox did it beautifully.

    And then, I finally got fed up. After all those years and all the delaying and all the excuses I made for Firefox, I decided a couple months ago that I would go full time Chrome and just see what it was really like. The result? I'm sold on Chrome, now. I can't believe I'm saying this, but I am. I never have to restart due to it behaving slow. I never have to restart due to it using too many resources. I never have it beach-balling for a minute at a time for every action I do. I never have Windows telling me the application has stopped responding. It just works.

    And here's the thing. It uses just as many resources, sometimes. Just like Firefox, I sometimes find it using as much as 3gb of memory. But where Firefox would start grinding to a halt around 1.5-2.5gb of usage, Chrome just keeps smoothly chugging along under as much as 3gb (and possibly more, but it never has used more than that, so I don't know).

    So, we can make all the excuses we want for Firefox. When it comes down to it, what matters is that my browsing habits cause Firefox to perform fucking terribly, while Chrome doesn't flinch. And when it comes down to my time and sanity, I need performance; not excuses.

  • by Ihmhi ( 1206036 ) <> on Tuesday January 17, 2012 @12:41PM (#38726026)

    Agreed. IE is shit, and I don't trust Chrome.

    I know it might be judged as paranoid and irrational (and to a degree, it is), but I really want the bare minimum of Google products on my computer. I just don't trust them. I've seen too many previously "good" companies abuse their power once their product is entrenched on everyone's computer, and I don't want to give Google much of a chance in that respect.

    Firefox isn't only the best for my needs, it's also the least of all evils that has the features I want.

  • by Korin43 ( 881732 ) on Tuesday January 17, 2012 @02:06PM (#38727196) Homepage

    Both machines run FF 3.6 because I keep reading that later versions have worse memory use and UI performance characteristics.

    ... people say that 3.6 is more responsive (especially on older HW) than the newer versions.

    Those people are wrong. Newer versions of Firefox are *much* faster and use less memory. In fact, lowering memory usage became a priority right about the time you stopped upgrading. Ironic, eh?

The best defense against logic is ignorance.