Slimming Down Add-Ons

November 19, 2011

Since early this year, the developers at the Mozilla organization have been working on reducing the memory requirements of the Firefox browser, in an effort called MemShrink.  Firefox has had an acknowledged problem with memory leaks; after the browser has been running for a while, it tends to get slower as more memory is lost to useful application.  They’ve made a good deal of progress; beginning with Firefox 7.0, released in September, the memory footprint of Firefox has become noticeably smaller, and many of the more serious problems have been fixed.

Now the Firefox team is planning to turn its attention to memory allocation and use by add-ons.  The wide range of add-ons available for Firefox is one of the things that makes the browser attractive to many users; on the other hand, because the add-ons are generally developed by third parties, Mozilla does not control how they work (other than to screen them to eliminate obvious malware).   Justin Lebar outlined a new strategy for eliminating memory leaks in add-ons, in a blog post last week.

Given that add-ons are so frequently fingered as the causes of leaks, and given that so many add-ons leak, my thesis is that we should stop using the fact that we don’t control add-ons’ code as an excuse not to try to fix this situation.

He sees this as a logical extension of the work Mozilla already does to screen out malicious add-ons, and advocates a three-pronged approach, which he calls “the Carrot, the Stick, and the Wrench” (these have been filed as bugs in Bugzilla).

The Carrot (bug 695471) would establish a process under which all new add-ons would be screened for the most common types of memory leaks.  This should help ensure better-behaved add-ons in the future.

The Stick (bug 695481) would identify add-ons with memory leak problems, so that users could make an informed choice before installing them.  As Lebar notes, the process needs to be set up to be fair to add-on developers, but a similar exercise, conducted earlier, for slow-starting add-ons, produced some real improvements.

The Wrench (bug 695348 initially) “used as a tool, not a bludgeon” is an attempt to provide ad-on developers with better diagnostic tools to track down and squash memory allocation bugs.  Probably a range of tools will be needed.

This is a welcome effort to provide developers with the means to identify and fix memory leaks in their add-ons, to give them an incentive to do so, and to empower users to make informed choices.

%d bloggers like this: