Categories: developers end users

Test your add-ons for memory leakage

The most common type of add-on memory leakage is Zombie Compartments, where an add-on accidentally holds on to parts of a web site in memory after a tab is closed, and massive amounts of memory may be eaten up if these tabs accumulate.

While in most cases they don’t accumulate, for the relatively small proportion of users this affects, the entire browsing experience is negatively impacted. We have been tracking add-ons that create Zombie Compartments and have fixed many of those instances ahead of yesterday’s Firefox 15 release, which now handles them automatically.

For the user, this means it is now less likely that an add-on will cause a slowdown in browsing. Add-ons are often cited by our users as the main reason they love Firefox, so it’s important that we continue to optimize the way Firefox handles their memory usage.

What does it mean for add-on developers?

To ensure people continue to have a good browsing experience while using the add-ons they love, please do your part in testing your add-ons. The fix in Firefox 15 handles most instances of Zombie Compartments, but that doesn’t mean they can’t still be created.

This MDN article includes pointers on how to find these types of leaks and how to avoid them. The main take-away is this: don’t hold any references to DOM objects after the document is closed. Your help in testing both the add-ons you’ve created and the add-ons you use is vital, and greatly appreciated!