Mozilla Adblock bug can dramatically boost memory usage

Mozilla warned this week that the popular Adblock Plus plugin could potentially suck up gigabytes of memory from PCs using its Firefox browser, thanks to bugs and the design of the plugin itself.

And, perhaps not surprisingly, the amount of memory consumed will increase no matter which browser you use, although Firefox appears to be one of the culprits.

Any additional elements added to a browser increase its memory usage, whether it be a plugin for Chrome or Firefox. One of the more popular is AdBlock, which, as its name suggests, filters out the annoying ads that unfortunately pay for the salaries of sites like PCWorld and others. AdBlock Plus has over 19 million users on Firefox alone.

AdBlock sits in your browser and quietly stomps ads.

For a site with a high number of ads, filtering those ads can put a strain on the browser's memory consumption. Browsing one site, for example, without AdBlock consumed 194MB of memory. That leapt to 417MB with AdBlock on, according to Nicholas Nethercote, a developer for Mozilla who outlined some of the problems in a blog post. Using another test site, memory usage jumped from 370MB to a whopping 1,960MB with the AdBlock plugin enabled.

According to Nethercote, simply enabling AdBlock Plus consumes 60-70MB on a 64-bit build of Mozilla. But the plugin also consumes 4MB or so per iframe, which pulls in content from an external site.

The reason, according to AdBlock, is twofold: one is a bug in which the way Firefox handles stylesheets, and the other is simply the way in which Adblock stores its filters.

"Current filter lists for Adblock Plus have around 50 thousand filters which (along with supplemental data like filter hits) require around 60 MB of memory," Wladimir Palant, a developer, wrote. "Clearly, that data is stored in a less than optimal way but apparently that’s hard to avoid when working with complicated JavaScript objects."

So what can you? Apparently one solution is either to ditch Firefox for now or turn off AdBlock entirely. Palant also wrote that AdBlock hopes to come up with a new way to implement and store data, as well as determine which filters are actually being used and which have become unnecessary. Until then, you'll pay in terms of memory consumption what you'll avoid in loud, squalling ads.

Subscribe to the Windows Tips & Trends Newsletter

Comments