Firefox 7 and Browser Memory Consumption

28 September 2011 by Matthew Gertner - Category: Industry News

Firefox 7 is out with an emphasis on improved memory consumption. Mozilla developer Nicholas Nethercote:

Firefox 7 uses less memory than Firefox 6 (and 5 and 4): often 20% to 30% less, and sometimes as much as 50% less. In particular, Firefox 7?s memory usage will stay steady if you leave it running overnight, and it will free up more memory when you close many tabs.

This sounds like real progress even if the figures cited seem a bit overblown, based as they are on an artificial scenario (opening 150 browser windows on a machine with 16Gb of RAM). Web pages take up RAM mainly because their in-memory representation (DOM) is large. Browsers with a lot of pages open unavoidably use a lot of memory (and I can attest personally that Chrome is no exception). It therefore makes sense to focus on areas where big improvements can be made, like freeing memory more quickly when pages are closed. Don’t expect memory usage to halve during real world usage, but it should improve significantly if you open and close pages a lot (and who doesn’t?).

The other memory-related improvement is to memory consumption when the browser is left idle. Apparently this is related primary to a subtle bug introduced in Firefox 4. As a result, JavaScript garbage collection was not being triggered in some cases (especially on machines with limited RAM).


« - »
COMMENTS
  • http://www.facebook.com/people/Ted-Mielczarek/579247655 Ted Mielczarek

    I think if you read Nick’s comments you’ll note that he was very careful to couch this only in terms of potential gains. He, of all people, knows that memory usage varies wildly based on the usage scenarios, so his estimates are specific worst cases.

    • http://www.salsitasoft.com Matthew Gertner

      Sure, didn’t mean to imply that his post was misleading. Of course the tech press jumped all over the 50% figure.

  • Abral

    I think memory usage of the browser is largely due to JavaScript than to DOM representation.
    However there are other improvements in memory handling, like less fragmentation, that improve also the overall performance.

    • http://www.salsitasoft.com Matthew Gertner

      If you know of any metrics about memory consumption from DOM vs. JavaScript, I’m interested. I took a quick look and didn’t find anything, but I haven’t had time to look too hard yet.

      • Abral

        I just read data from about:memory.

  • http://kairo.myopenid.com/ Robert Kaiser

    The 50% figure is completely non-artificial, it comes from reports of Beta users. And even the 20-30% figure comes from in-field reports of users. The artificial scenarios usually showed 10-20% improvements. The developers that did those patches, including Gregor (fellow Austrian I chatted with quite a bit two weeks ago), were pretty surprised about users reporting back higher memory saving numbers than what was internally seen with test scenarios.

    • http://www.salsitasoft.com Matthew Gertner

      The blog post made it sound like those figures came from Membench (at least that was my interpretation), but if they are from real-world user reports, that’s excellent.