+ Reply to Thread
Results 1 to 7 of 7

Thread: Breakthrough: Mozilla To Eliminate Add-on Memory Leaks

  1. #1
    BrianBosworth's Avatar
    Join Date
    17.04.08
    Location
    Under The Radar
    P2P Client
    Bangladesh Extreme Mod
    Posts
    196
    Activity Longevity
    0/20 19/20
    Today Posts
    0/5 ssssss196

    Breakthrough: Mozilla To Eliminate Add-on Memory Leaks

    When it comes to the Firefox web browser, add-ons are without doubt one of the most important feature that are making the browser attractive to a lot of users. It is in fact still a feature that is setting the browser apart from other web browsers, be it Opera or Chrome. Add-ons can however also cause issues for users of the browser, especially when it comes to memory leaks. This in fact may be one of the reasons why users see the browser’s memory use grow over time on the operating system.

    To make matters worse, Firefox is still seen by many as the browser with the worst memory management, even though that is not really the case, if you level the playing field. Depending on the add-ons installed, and versions of the browser used, results may vary.

    Mozilla very recently made a breakthrough that has not yet been picked up by any tech news site out there. In fixing the memory leak, Mozilla developer Kyle Huey explains how he fixed add-on memory leaks once and for all in the web browser.

    My approach takes advantage of the fact that chrome code lives in a separate compartment from web page code. This means that every reference from chrome code to content code goes through a cross-compartment wrapper, which we maintain in a list. When the page is navigated, or a tab is closed, we reach into chrome compartment and grab this list. We go through this list and “cut” all of the wrappers that point to objects in the page we’re getting rid of. The garbage collector can then reclaim the memory used by the page that is now gone.

    In layman terms, Firefox is now blocking add-ons from accessing content in the browser that does not exist anymore.

    Memory usage over time of a specifically prepared test suite has dropped by 80%. Instead of climbing up to 800 or 900 Megabytes at the end of the day, Firefox would now use about 230 Megabytes instead. Even on systems with lots of memory, users will still see benefits due to garbage collection and cycle collection pauses.

    However, what if the user has a high-end machine with 16GB of RAM? Then paging isn’t an issue. But this improvement will still be a big deal on such a machine. This is because garbage collection and cycle collection cause pauses, and the length of the pauses are roughly proportional to the amount of live heap memory. (Incremental garbage collection will soon be enabled, which will result in smaller garbage collection pauses, but there are no plans for incremental cycle collection and so cycle collection pauses will still be relevant.) So even on high-end machines with lots of RAM, leaks can greatly hurt browser performance.

    There is however still one issue that Mozilla needs to get their heads around. The patch managed to prevent the single most common class of add-on leaks, but has caused another leak to come forward that is caused by add-ons that have been compiled with an older version of the Add-on SDK. It may take some time before that issue is resolved by the developers, but once that is resolved, you can wave goodbye to add-on memory leaks.

    Firefox users who want to try a version of the browser with the feature enabled, can download one of the latest Nightly builds from Mozilla to do so. These are cutting edge development builds, and not suitable for productive environments. If things go along as planned, we will see the feature as early as in Firefox 15 which is scheduled for an August 28, 2012 release.
    Breakthrough: Mozilla To Eliminate Add-on Memory Leaks
    Reply With QuoteReply With Quote
    Thanks

  2. Who Said Thanks:

    leechmodder (08.05.12) , slikrapid (08.05.12)

  3. #2
    Moderator anon's Avatar
    Join Date
    01.02.08
    Posts
    39,439
    Activity Longevity
    8/20 19/20
    Today Posts
    1/5 ssss39439
    Firefox users who want to try a version of the browser with the feature enabled, can download one of the latest Nightly builds from Mozilla to do so.
    I'd appreciate if anyone trying that could post feedback here. With my setup, Firefox can easily use 500 MB of memory and over a gig of commit after running for several days. I'm partly at fault however, by surfing and opening tabs like there's no tomorrow (that's why Chrome's "one process per tab and extension" was a huge no-no).
    "I just remembered something that happened a long time ago."
    Reply With QuoteReply With Quote
    Thanks

  4. #3
    Moderator
    Instab's Avatar
    Join Date
    17.09.09
    Posts
    6,661
    Activity Longevity
    4/20 17/20
    Today Posts
    0/5 sssss6661
    i'm usually using the nightlies and the only leaks i ever had were the flash plugin. only with the 64bit version tho. the 32bit never had leaks.
    Your account has been disabled.
    Reply With QuoteReply With Quote
    Thanks

  5. #4
    Moderator anon's Avatar
    Join Date
    01.02.08
    Posts
    39,439
    Activity Longevity
    8/20 19/20
    Today Posts
    1/5 ssss39439
    Quote Originally Posted by Instab View Post
    i'm usually using the nightlies and the only leaks i ever had were the flash plugin.
    I'm confused now, I thought the article only referred to addons (like NoScript)?
    "I just remembered something that happened a long time ago."
    Reply With QuoteReply With Quote
    Thanks

  6. Who Said Thanks:

    Instab (13.05.12)

  7. #5
    Quote Originally Posted by Instab View Post
    i'm usually using the nightlies and the only leaks i ever had were the flash plugin. only with the 64bit version tho. the 32bit never had leaks.
    Same here.And yes I think the article is talking about addons not plugins.
    Reply With QuoteReply With Quote
    Thanks

  8. Who Said Thanks:

    Instab (13.05.12)

  9. #6

    Join Date
    16.01.11
    Location
    Japan
    P2P Client
    Dragon Fist
    Posts
    133
    Activity Longevity
    0/20 16/20
    Today Posts
    0/5 ssssss133
    I'm glad to hear things are getting fixed, day after day. I'm still waiting to hear that Firefox is making a comeback but it might not be happening too soon, or at all. As for me, I'll still be nightly and enjoyin' new features like pdf preview that I've been waiting for a very long time.
    Reply With QuoteReply With Quote
    Thanks

  10. #7
    Moderator
    Instab's Avatar
    Join Date
    17.09.09
    Posts
    6,661
    Activity Longevity
    4/20 17/20
    Today Posts
    0/5 sssss6661
    Quote Originally Posted by anon View Post
    I'm confused now, I thought the article only referred to addons (like NoScript)?
    Quote Originally Posted by SBfreak View Post
    Same here.And yes I think the article is talking about addons not plugins.
    my bad, but even better then because without plugins i never had such leaks
    Your account has been disabled.
    Reply With QuoteReply With Quote
    Thanks

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •