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

 



Forgot your password?
typodupeerror
×
Mozilla The Internet Software

Real-World Firefox 3 Memory Usage Leads the Field 406

An anonymous reader writes "The author developed a program to snapshot memory usage per process every 3 seconds on Windows. Using this he recorded 3 hours of memory usage for five different browsers under real-world usage scenarios: Safari 3.1, Firefox 3, Flock 1.2 (a browser based on Firefox 2), Opera 9.5, and Internet Explorer 8. A million data points indicate that Firefox 3 has a surprising advantage over the other browsers tested. These are real-world tests and not contrived benchmarks."
This discussion has been archived. No new comments can be posted.

Real-World Firefox 3 Memory Usage Leads the Field

Comments Filter:
  • by Mascot ( 120795 ) on Tuesday June 24, 2008 @05:35PM (#23924855)

    The article states FF3 is an improvement over FF2, without offering data points for FF2. However, it also mentions Flock is based on FF2, so I'm guessing they've assumed the Flock data is representative for FF2.

  • by Nightspirit ( 846159 ) on Tuesday June 24, 2008 @05:38PM (#23924901)

    Am I the only one that thinks although firefox 3 is much faster, firefox 2 was much more stable? I'm running it on vista, XP sp3, and ubuntu machines and FF3 crashes on all 3 of them.

  • Wait (Score:4, Informative)

    by Mensa Babe ( 675349 ) * on Tuesday June 24, 2008 @05:38PM (#23924911) Homepage Journal

    Don't get overexcited just yet. Let me quote some of the most important parts of the article that were completely overlooked in the summary for some reason:

    "These results are from opening Memory Watcher and then using the browser between 9,000 and 11,000 seconds (close to 3 hours). Each browser is tested in a separate session, and there are brief periods of inactivity throughout the time period. [...] The above profiles are not a direct comparison in any way, but they offer a visualization of trending in the memory behavior of the layout engines and interfaces. [...]These aren't stress tests, and I probably never went over 4 windows in each browser, with at most 3 tabs in each window. [...] An automation script will never give the same insight into performance over time as will this sort of profile." [emphasis added]

    In other words, it is evident that there was no guarantee whatsoever that every browser would display exactly the same sequence of web pages. It is easy to jump to conclusions that if Firefox has used the least memory then it must "[have] a surprising advantage over the other browsers." But is it a logical course of reasoning? Or only a post hoc ergo propter hoc fallacy combined with wishful thinking? The truth is that the amount of memory used during an hour of downloading web pages is strongly correlated with the speed of downloading and displaying said web pages. Is it the case that Firefox couldn't download, format and display pages as quickly as Internet Explorer because of the native Windows internal API hooks that help Explorer work faster than any independent browser could possible aspire to? That is quite possible. Unfortunately the results of that experiment are inconclusive and the methodology was unreliable.

  • If slashdotted (Score:5, Informative)

    by Anonymous Coward on Tuesday June 24, 2008 @05:39PM (#23924929)
    Final memory usage in MB
    Safari 636.9
    Firefox 3 111.8
    Flock (Firefox 2) 191.9
    Opera 9.5 190.6
    Internet Explorer 194.4
  • by Anonymous Coward on Tuesday June 24, 2008 @05:47PM (#23925027)

    I can't be arsed to do this properly. There are a lot of graphs and stuff. But here are the text bits. Pure copy and paste. No formatting. Live with it.

    Web browser performance is an often talked-about and flaunted thing, but many claims are not really backed up by solid evidence. I wrote software that collected millions of data points over 14 hours of actual browsing time, and this article reveals my findings.

    Problem

    Many people load hundreds of web pages, sometimes at the same time, often over periods of 3+ hours. Users complain about the memory usage of Firefox, Safari, or Internet Explorer, and we need a way to identify which browsers are better at managing memory than others. Traditional benchmarks do not look at all the things you might do with a program, and we need real-world numbers over a period of hours.

    Solution

    I developed a Windows Forms application in .NET called Memory Watcher that "watches" the system memory numbers. It uses a timer to poll the processes every 3 seconds. It then records every number and also prints them out in a grid on the screen. This allows us to keep track of each program's memory usage over time and with real-world usage.
    Memory Profiles

    These results are from opening Memory Watcher and then using the browser between 9,000 and 11,000 seconds (close to 3 hours). Each browser is tested in a separate session, and there are brief periods of inactivity throughout the time period. The vertical axis is the memory used in MB, and the horizontal axis contains the memory "checkpoints" my program took (one every 3 seconds).

    (Graphs and more graphs)

    Benchmark Details

    The above profiles are not a direct comparison in any way, but they offer a visualization of trending in the memory behavior of the layout engines and interfaces. This is not a diagnosis or bug report. Let me show some important metrics of the above results.
    Browser name Exact version Time active (s)
    Hours Comments
    Safari 3.1.2 10,470 s
    2.91 hours Normal browsing
    Firefox 3.0 9,681 s
    2.69 hours Normal browsing
    No extensions
    Flock 1.2.2 10,146 s
    2.82 hours Flock is based on Firefox 2.0
    No extensions other than the default
    Opera 9.5 9,855 s
    2.74 hours No extensions
    Only browser was used
    IE 8.0 10,236 s
    2.84 hours Used 7.0 rendering mode
    No extensions

    The system is Windows Vista SP1, and the computer has 3.0+ GB of RAM. No plugins are disabled, but the Acrobat Reader and Java plugins were (presumably) not used. Flock is based on Firefox 2.0 but its memory usage is probably worse because it uses built-in extensions.

    * Just regular stuff
    * These aren't stress tests, and I probably never went over 4 windows in each browser, with at most 3 tabs in each window. I didn't look at many pages that are extremely heavy on images, and no "browser benchmark" style pages. Gmail was used on each browser.
    * Not just pages
    It is hard for a regular benchmark to "simulate" a user actually clicking on things. Interactions with the user can greatly influence memory or performance. Having a responsive browser is probably more important than just having a "fast" one at showing pages.
    * Plugins included
    My profiles include Flash and possibly other plugins. A browser might have memory issues with a plugin and that could cause a significant problem with the user experience. (Most Windows Vista crashes have been due to graphics cards, not Vista itself, for example.)
    * Real-life usage
    An automation script will never give the same insight into performance over time as will this sort of profile. As developers, we want to make programs that work wel

  • by Curien ( 267780 ) on Tuesday June 24, 2008 @05:52PM (#23925097)

    My wife and I share a computer. She uses mostly uses Firefox, I mostly use Opera. This is on a 64-bit Ubuntu Hardy.

    I have noticed no difference in her memory usage since we upgraded to FF3. I used to regularly have to kill her browser every once in a while (maybe once or twice a week) because it was eating up all the RAM. Since we upgraded to FF3, I can see no difference in memory usage.

    For example, right now FF is using 300MB resident, Opera is using 100MB. Flashblock is installed on both browsers. Granted, that's not a terribly good test considering we've been browsing to different sites, but I've found that those numbers are fairly stable. FF usually levels off in the 300-500MB range, and Opera in the 100-150 range.

    YMMV.

  • by toleraen ( 831634 ) * on Tuesday June 24, 2008 @05:52PM (#23925101)
    Tests need to be repeatable, and when they are repeated they need to provide consistent results. If you can't provide consistent results on each subsequent test, you need to provide solid rational on why the results were outside your margin of error. Saying "Oh, I might have had one or two youtube videos up at the time" is not solid rational.

    Scripts that visit the exact same pages, for the exact same time, do the exact same things across all browsers provide consistent, quantifiable results. Since everyone's browsing behavior is different no script will ever provide "accurate" results for real world usage. But then again, those scripts could be closer to my real world usage than this guys anecdotal test. Get it?
  • by rrkap ( 634128 ) on Tuesday June 24, 2008 @05:54PM (#23925125) Homepage

    I haven't had Firefox 3 crash for me yet (although I've only been using it since Download Day). I have noticed that it no longer gets hung up processing javascript the way Firefox 2 often did.

  • Irrelevant... (Score:4, Informative)

    by at_slashdot ( 674436 ) on Tuesday June 24, 2008 @05:58PM (#23925175)

    That's pretty much irrelevant to me, I switched back to Opera because of performance issues.

    Memory != performance.

    For example, when I open a new tab in opera the CPU doesn't register almost any change, when I open a tab in Firefox it goes almost to 100% (that's in Linux, with many extensions added, and BTW, I need those extensions to duplicate Opera's features)

  • Definitely important (Score:5, Informative)

    by XanC ( 644172 ) on Tuesday June 24, 2008 @06:04PM (#23925231)

    In the case of Firefox, memory usage has ranged from 25MB to $MEMORY_AVAILABLE. Which sucks no matter how much you have.

  • What cap? (Score:5, Informative)

    by clarkn0va ( 807617 ) <<apt.get> <at> <gmail.com>> on Tuesday June 24, 2008 @06:14PM (#23925345) Homepage

    Setting a cap on memory usage isn't a good solution, IMHO -- using well-designed memory handling that proactively frees memory seems to me to be a far better solution than a cap and garbage collection model.
    I haven't seen any mention of a cap, even if that's a natural conclusion based on the flat line that one can observe in the graphs.

    If you check this [pavlov.net] fairly lengthy explanation of how memory usage was improved in FF3 you'll see that it is mostly attributed to reduced fragmentation and leaks, and smarting caching, just as you are advocating.

    db

  • by Tweenk ( 1274968 ) on Tuesday June 24, 2008 @06:19PM (#23925419)

    The OS was Vista, and the program was written in .Net to use the function PrivateMemorySize64 [microsoft.com]. MSDN says it returns "the amount of memory which cannot be shared with other processes". It also says it's the same as the "Private Bytes" value in taskmon. Probably it means that it's the amount of memory the process received from mallocs (or rather GlobalAllocs/LocalAllocs/HeapAllocs), and which can't be assigned to some other process.

    It's worth noticing that the guy bothered with a GUI and an interactive filtering option for such a simple program. I wonder whether he ever heard of CLI, because it looks like a perfect fit for this kind of program.

    By the way, why not post CoralCDN links (append .nyud.net to hostname) instead of direct links when the site in question is small and likely to be Slashdotted?

  • Re:Careful... (Score:3, Informative)

    by Vectronic ( 1221470 ) on Tuesday June 24, 2008 @06:25PM (#23925483)

    Some, but I'm not one of them, my Opera (9.51 on XP SP3) has been running for a few days now (almost 4), with a peak of 157MB, currently at 96MB, VM of 114MB, and an I/O of almost 12GB's... opening up every site on my SpeedDial (9 sites + this one) brought me up to 122MB, VM of 140MB...

    But, I honestly don't care how much it uses, because so far it hasn't impacted (noticeably) on any other software, and always starts (launches, or maximizes) instantly, and I prefer Opera's interface. And how much memory it uses isn't enough to make me prefer one browser over another... CPU usage on the other hand, might, but most of them are pretty much the same in that regard.

    And after closing all those tabs, its down to 92MB, VM 110MB, peak the same.

  • by diegocgteleline.es ( 653730 ) on Tuesday June 24, 2008 @06:41PM (#23925697)

    64-bit firefox eats a LOT more of memory. The windows versions are 32-bit only.

  • by MrFlannel ( 762587 ) on Tuesday June 24, 2008 @06:49PM (#23925777)

    On the off chance you're not just trolling...

    Instructions are here:
    http://www.kennycarlile.net/2008/06/17/disable-firefox-3-awesomebar/ [kennycarlile.net]

    Took me all of 10 seconds with google: "Firefox3 Awesomebar disable". So... I guess you'll enjoy firefox 3 with the smaller memory footprint (assuming TFM is correct).

  • by bunratty ( 545641 ) on Tuesday June 24, 2008 @06:59PM (#23925903)
    You mean like these consistently reproducible results [arstechnica.com]?

    Firefox 3 used less memory than Firefox 2, Internet Explorer, and Opera, and it also freed more memory than the other browsers when pages were closed... The results of this experiment, which others have been able to consistently reproduce using the same tools, represent a big victory for Firefox, which has previously faced widespread criticism for its high memory consumption.
  • by antdude ( 79039 ) on Tuesday June 24, 2008 @07:30PM (#23926305) Homepage Journal

    NetworkMirror [networkmirror.com].

  • by Sits ( 117492 ) on Tuesday June 24, 2008 @07:43PM (#23926443) Homepage Journal

    Look at this article talking about memory usage in Firefox 3 by mozilla dev Parlov [pavlov.net]. There is a graph there that suggests Firefox 2 uses around 80Mbytes more memory than Firefox 3 over time.

  • by Onyma ( 1018104 ) on Tuesday June 24, 2008 @07:46PM (#23926481)
    If an aftermarket upgrade part on your car causes the engine to blow up do you blame the original manufacturer of the car? It's not feasible to expect a framework to catch every possible problem that could arise from a poor implementation of that framework. You'd like to catch most of them but there will always be someone or something that can fubar it in ways you never imagined.
  • by Sits ( 117492 ) on Tuesday June 24, 2008 @07:59PM (#23926603) Homepage Journal

    Memory that is being shared between processes (e.g. through the use of libraries) is actually counted towards the RSS so something that is sharing a lot of pieces with another process may appear artificially high [blogspot.com].

  • by Alibaba10100 ( 1296289 ) on Tuesday June 24, 2008 @08:39PM (#23927019) Journal
    Based on my experience, the flock data is not representative of firefox 2. After running firefox and using tabs for a few hours, it would often be using around 300mb of my memory, while the data shows flock maxing out at 200mb.
  • Except on Linux (Score:5, Informative)

    by DrYak ( 748999 ) on Tuesday June 24, 2008 @08:52PM (#23927153) Homepage

    It would be a stupid design to leave lots of RAM free, and reload stuff over the net.
    Well, it depends on your OS.
    Linux automatically uses all free memory for disk cache, and is very efficient at it. Instead of hogging memory that could be used by other process, Firefox could exclusively rely on a disk cache and rely on Linux' native and performant disk-cache to handle the in-memory caching of those files.
    The best part of this is, if some other process needs the memory, Linux will simply free some memory from the cache, but the files will still be ready on the disk and the over application will still be performing well. Whereas if a 120Meg space is enforced a in-RAM cache, when memory becomes scarce, the system is at risk of paging out piece of the software (pages of code itself instead of pages holding cache) and thus make the whole system less responsive.

    The GC is just for JavaScript (required by design) and for DOM nodes which end up being circularly referenced (which is unavoidable).
    You would only need to keep the DOM nodes of the current page. Past pages are freed and don't (usually) keep DOM objects alive.

    Finally, 120MB is not a lot of RAM.
    Well, it depends. Notice that Linux is also very often used on kiosk with limited features and on old hardware which may not have huge amounts of resources.

    Being able to run within a small memory space is critical for linux. Otherways, there won't be any difference with Vista.

    Also a lot of problems are comming from bad Add-ons or even half-assed Browser Plugins. Flash is such a pain in the ass that can momentanily freeze the whole browser session.

    Disclaimer : I run Firefox on Linux with in-memory cache disabled and using Gnash plugins instead of Flash (runs in separate process and can have autostart disabled). Adblock+ and Noscript also help avoiding that my browser loads tons of useless shit. And until recently my main desktop was a Pentium-III with 440BX chipset (a machine on which 1GiB of RAM is a rare occurence), but I didn't get any major problem even on recent distros. (Vista on the other hand had to wait)

  • by tepples ( 727027 ) <tepples.gmail@com> on Tuesday June 24, 2008 @10:07PM (#23927799) Homepage Journal

    Windows XP has a "switch user" feature
    When you press switch user and then walk away from the PC, your copy of Firefox gets swapped out and hers gets swapped in. But then I guess Firefox should be flushing the memory cache to disk when switched out.
  • Re:Irrelevant... (Score:5, Informative)

    by Grey Ninja ( 739021 ) on Tuesday June 24, 2008 @11:10PM (#23928471) Homepage Journal
    That sounds like all your rendering is being done on the CPU to me. Windows will do the same thing if you refuse to use Nvidia's binary only Windows driver.

    That being said, I have similar problems on my laptop, where scrolling a window often will peg my CPU. In my case, I have an older Intel integrated chip, which does a lot of 3D rendering on the CPU. Since the advent of AIGLX, it makes some rendering on my laptop fairly slow. At least, I THINK that's what's going on there. It's never really bothered me enough to look into it in-depth.
  • Re:Hi twitter (Score:3, Informative)

    by gilgoomesh ( 966411 ) on Wednesday June 25, 2008 @03:21AM (#23930447)

    I've been running Safari 3.1.1 all day (about 6 hours non-stop with 462 pages in history) and it's currently using 230.9MB RAM (fairly steady).

    Opening up FF3 to check, loading 52 pages then closing down one again... 129.18MB.

    Not a totally fair comparison but it's some numbers, nonetheless.

  • by MrNemesis ( 587188 ) on Wednesday June 25, 2008 @05:22AM (#23931277) Homepage Journal

    Damnit, can't use mod points in this thread now.

    The way I've found to restore sane address-bar behaviour was to do the following:
    Install the oldbar extension
    about:config browser.urlbar.matchOnlyTyped boolean set to true.

    Bingo! No more hyper-annoying address bar.

Saliva causes cancer, but only if swallowed in small amounts over a long period of time. -- George Carlin

Working...