AdBlock Plus Firefox plugin could consume gigabytes of RAM

Posted May 16, 2014 by James Walker
One of the most popular Firefox plugins used by millions worldwide has been revealed by Mozilla to potentially consume megabytes, or even gigabytes, of RAM on users' machines while enabled during browsing.
People wait to attend a Mozilla Firefox press conference.
People wait to attend a Mozilla Firefox press conference.
Josep Lago, AFP/File
AdBlock Plus which purports to block the garish, distracting advertisements found on a vast multitude of websites today, has attracted a vast following who find that on the whole it lives up to its claims and so makes web browsing more enjoyable and faster while lowering the amount of data used to download websites by hiding and disabling adverts on webpages.
However, whereas data consumption may be lowered, a new report from Mozilla suggests that enabling the popular plugin could result in exceptionally large amounts of RAM being consumed by the program.
They found that just enabling the plugin on a 64-bit based system could result in a constant additional RAM usage of 60-70MB on top of which Mozilla normally uses.
This may not initially sound like a substantial amount until you realise that this is just the overhead incurred by even having the plugin enabled. Whilst browsing a relatively ad-loaded website such as TechCrunch, Mozilla found that RAM usage by Firefox increased by over 200MB with AdBlock enabled. Without the plugin Firefox used 194MB of RAM; with it enabled it jumped to 417MB on the same page. With some really intensive websites such as the VIM Color Scheme Test the plugin ended up consuming nearly 2GB of RAM at 1960MB. Without it just 370MB was used.
The AdBlock Plus development team recently acknowledged the issue on their blog and commented that the exceptional RAM usage was caused by a number of known bugs including the fact that the plugins method of blocking adverts by injecting stylesheets into HTML iFrame containers incurs a gradual build-up of 4MB per iFrame and that Firefox ends up duplicating these stylesheets for each new page loaded eventually resulting in the immense RAM usage noted by Mozilla. They also said that the very way in which the plugin catalogues known adverts results in the 60-70MB overhead noted on any machine with the plugin noted and said that they will be looking at ways of "identifying [and getting rid of] unnecessary memory consumption" whilst warning that 'the potential is limited here as long as we stick to JavaScript objects.' Hints of a major update were dropped as the team said "we want to implement our own way to store data" as an alternative to using the memory-intensive JavaScript data structures currently implemented.
For users who have large amounts of RAM installed on their machines, such as 8GB or more, this memory consumption may not prove to be too significant but if you are running a netbook with only 2GB of RAM or perhaps less then very significant slow-downs could be noted by users if AdBlock Plus's memory usage hits the levels that Mozilla saw it achieve in testing.