More on Firefox Memory Improvements

Asa Dotzler

We’ve worked non-stop for the last year to improve the way Firefox uses memory, and our newest Firefox release contains one of the biggest improvements yet. We’ve gone beyond optimizations of Firefox code itself, and have now plugged the main cause of memory leaks in Firefox add-ons, as well.

Browsers do a lot more work than they used to. Typical Firefox users today don’t just load pages of text, we run high performance Web applications with a rich set of HTML5 features. We keep those pages open for longer, and have more of them open at once. We’re living so much of our lives online that browsers have become like operating systems, sometimes running dozens of applications at once.

To do that work well, Firefox memory usage needs to be excellent. For the last year, we have worked to make Firefox incredibly memory efficient. Not only does that let us run lean and fast, it also leads to big improvements in responsiveness and stability. We’ve addressed hundreds of issues, from fixes for dozens of small memory leaks to major new architectural changes. The Firefox of today is a significantly different product than that of a year ago, and our users feel the difference.

Having fixed the larger Firefox issues, it was time to tackle the next big source of memory leak: poorly written add-ons. Add-ons are a core part of the Firefox experience, so we began to test popular add-ons and work with their authors to plug leaks and use memory more efficiently. Add-ons aren’t intrinsically leaky, but the memory team identified dozens of add-ons that were causing huge memory leaks and made significant process improving the experience for Firefox users.

There are lots of add-ons, though. Testing and patching each of them in turn is an impossibly difficult project, and new problems can be introduced to add-ons after our testing. The most common cause of these leaks is when an add-on accidentally holds on to extra copies of a web site in memory after our user has closed the tab. These pages pile up, and can eat massive amounts of memory for no user benefit. They leak.

In the newest Firefox release, we developed a mechanism to prevent this form of leak from happening in the first place. Firefox will now detect this pattern, recapture the leaked memory, and free it up. This means that Firefox stays responsive and stable even if an add-on is making this mistake.

As the web continues to evolve as the world’s best platform for development and innovation, we will continue to performance tune Firefox. Add-ons are a great way to customize Firefox to your needs and interests, but you shouldn’t need to worry that they are harming your browser’s performance. There will always be more work to do, but with the latest Firefox release, our users are going to see a leaner, faster, more stable browser; take it for a spin.