Last November, I posted a note about Mozilla’s MemShrink project, focused on reducing the memory requirements of its Firefox Web browser. At that point, some very significant progress had been made with the browser itself, and the project team was beginning to turn its attention to memory use by browser add-ons. The extensive range of add-ons available for Firefox is attractive to many users; on the other hand, since add-ons are generally developed by third parties, Mozilla does not have complete control over how they work.
Now, according to a report at the “Webmonkey” blog at Wired, the Mozilla team has developed a patch that can largely prevent one of the most common causes of excessive memory consumption, the so-called “Chrome-to-Content” leaks. (NB: In this context, “Chrome” has nothing to do with Google’s browser of that name.) The code patch is currently being tested in the Firefox “nightly” development channel; Nicholas Nethercote, the leader of the MemShrink project, reports in a blog post that early tests of the modification have shown significant reductions in add-on memory usage, in some cases by a factor of four. This is impressive, especially since it is being accomplished without any changes to the add-ons themselves. (A more detailed description of the new patch, by its author, Kyle Huey, is available on his blog.)
Unfortunately, there is a small cloud to accompany this silver lining. Add-ons packaged with older versions of Mozilla’s Add-On Software Development Kit [SDK] can in some cases actually develop memory leaks when run with the modified browser. This is not good, since there are many add-ons out there that incorporate old versions of the SDK. The current version, 1.6.1, does not have this problem.
Still, the modification is a step forward, since it effectively addresses one of the most common causes of memory problems. Repackaging add-ons built with older SDK versions is straightforward, and should be done anyway, since the latest SDK version also fixes some other memory allocation bugs. Firefox 15, which will be the first release with the new code patch, is not scheduled for release until August 28, so there is time for the necessary work to be done, and Mozilla is trying to encourage all add-on developers to make sure their code is up to date.