File Under: Browsers

Mozilla Shrinks Memory Use in Firefox Add-Ons

Photo: Jim Merithew/Wired

Last year Mozilla launched MemShrink, an aggressive campaign to trim Firefox’s memory footprint. Since then not only has the browser’s overall memory use dropped considerably, but the effort has been expanded to tackle add-ons, a common source of Firefox memory woes.

Now Mozilla programmer Nicholas Nethercote, head of the MemShrink effort, reports that a new patch to prevent Chrome-to-Content leaks in Firefox add-ons results in “a 4x reduction in memory consumption.”

The new code is currently in Firefox’s Nightly channel for those that would like to help test it against a wide variety of add-ons.

Firefox contributor Kyle Huey, who wrote the new patch, has more details on how it works and where the memory leaks in add-ons come from. Huey writes that “it’s a little early to be sure what effects this will have, but the amount of leaks we see on our test suite dropped by 80 percent. I expect that this change will also fix a majority of the add-on leaks we see, without any effort on the part of the add-on authors.”

Unfortunately the hope that add-on developers wouldn’t need to do anything to reduce their memory use hasn’t panned out. Mozilla has since discovered that “there is an unfortunate side-effect of all this amazing, memory saving goodness which directly affects add-ons that have been packed with older versions of the SDK.” Mozilla is now asking add-on developers using older versions of the Firefox add-on SDK to repack their add-ons before the MemShrink efforts arrive in a final version of Firefox.

Luckily for Firefox fans there’s plenty of time for affected add-ons to be updated since the latest MemShrink efforts won’t make it to the final release of Firefox for at least another 12 weeks. When they do Firefox users will hopefully see a considerable drop in Firefox’s memory use making for a faster, less RAM-hungry web browser.