Firefox 41 ships with massive memory improvements for Adblock Plus
Version 41 of the Firefox web browser ships with memory improvements that benefit all users of the browser but Adblock Plus users especially.
When Mozilla ran memory tests against a set of popular Firefox add-ons recently it noticed that the popular extension Adblock Plus was adding an average of 60-70 Megabytes to the browser's memory usage.
It discovered furthermore that certain conditions could increase memory usage extremely so that the overall use of memory by Firefox would double, triple or even quadruple while sites remained open in the browser.
Tip: you can test this yourself by opening the following website in Firefox with Adblock Plus installed:
vimcolorschemetest.googlecode.com/svn/html/index-c.html. You will notice that memory will go up dramatically while the page loads and while it remains open.
The patch that Mozilla added to Firefox 41, currently available in the Nightly channel, optimizes memory usage in the browser. When you compare memory usage of an optimized version of Firefox to one that does not include the patch, you will notice massive improvements.
The screenshot above shows two instances of Firefox running on a PC with Windows 7 Pro 64-bit. Only the test web page was opened in the first and the result was a jump in memory to about 1.4 Gigabyte.
The test page did not increase memory nearly as much in the Nightly version of Firefox, especially since ten websites were already open prior to loading the test website in a new tab.
The reason for the increase in memory when visiting the test page in Firefox with Adblock Plus installed is that Firefox loads stylesheets multiple times even if they are identical when frames are being used on web pages.
Instead of sharing the stylesheet, it is creating copies of it for each frame on the page. The test page embeds lots of frames which explains the increase in memory usage as each frame adds about 3 Megabytes of memory to the browser's overall memory usage as Adblock Plus's stylesheet is about that size.
What the improvements that landed a couple of days ago help with is style sheets added at the user agent level (built in style sheets, such as those used for the default styling of HTML elements) or user level (which is where the userContent.css user style sheet is added, and where ABP adds its style sheet).
The memory optimization patch that landed in Firefox 41 enables the sharing of identical stylesheets. While that is been done mostly to improve the memory usage of Adblock Plus, all users of the browser benefit from the improvement even if they don't run Adblock Plus.
When a site uses frames for instance and references a stylesheet in a frame and on the main page, then it is loaded only once in memory instead of twice.
Tests showed small improvements in page loading time as well even though not nearly as impressive as the reduction in overall memory use.
The improvement benefits all users of the Firefox browser but especially Adblock Plus users. For Mozilla, it is not only about improving memory usage in Firefox but also bringing Firefox to levels of browsers it competes with. (via SÃ¶ren Hentzschel)
Interesting. Quick check using palemoon with gorhills ublock origin (and 4 other addons) gives 460 MB:)
650 megabytes is still quite a bit, despite the fact that many computers these days come equipped with 8 GB or more of Ram.
Still the culprit seems to be Ad Block Plus. Time to either use a Secure DNS to block ads and malware or a host file. Or simply uninstall Ad Block Plus and use uBlock Origin
“Still the culprit seems to be Ad Block Plus.”
No. Have you actually read the bug-description?
Attempting to handle / block via HOSTS file is an “exercise in futility”. It’s analagous to the game “Whack-a-Mole” ~~ you keep adding and adding and adding and ADDING hostname entries, playing reactionary catch-up and never entirely keeping abreast of the newly-added hostnames.
Case in point: Lookup “shallalist”, a categorized blocklist maintained and distributed by a (french, IIRC) university; intended for use in/on firewall appliances. Forty Million plus hostname entries last I checked (it’s updated approximately monthly), and it still doesn’t adequately cover the bases.
Although I employ a dns proxy blocklist (which contains 475,000 _patterns_, not hostnames) I wouldn’t rely on it as a “first line of defense”. FWIW, the dns proxy/caching app I’m using (since around 2006?) is freeware “dnskong”. It accommodates use of patterns which can be as generic/greedy as, say, “teens”… such that a single line, a single entry will match/block countless hostname variations. (Nowadays, following the explosion of new TLDs, hostnames you’d probably never guess are bound to show up, like “teens.onmyface.gratis”)
I’m VERY curious about this program dnskong! Can you please explain where you get the patterns and updates to those patterns so that it effectively blocks ads/trackers ? Also what do TLDs have to do with anything? PLEASE provide as much info as possible! :) Thank you!
Skrell, all the breadcrumbs you need are in the earlier post. You wanna “get” lists? Have ’em handed to you? If so, for starters, do a websearch for “shallalist”.
What do TLDs have to do with anything? Seriously?
Suppose, for the sake of example, that you intend to block “yahoo”.
With a HOSTS entry approach, your list would need to contain separate patterns for:
——- ad nauseum —— due to the availability of 500+ TLDs
Does yahoo have domains listed across all possible TLDs?
Idunno and don’t care to know. The point here is that your looooooong HOSTS list inevitably will be ineffective.
Hmmm . . . Firemin returned to active development and takes care of memory issues.
Pocket is still a mess, for me anyway. I must sign in every browser session?
My oh my! The improvements Firefox developers make never ceases to amaze me.
I did some impromptu testing to verify this myself just now (using Firefox 38.0.6 vs today’s Nightly) but I wanted to see ABP vs uBlock so… this is what I ended up with after creating fresh clean portable installs of both versions of Firefox using the latest dev builds of each addon and then running them from a RAMdisk. The page load is that link listed in the article, of course.
AdBlock Plus Dev 18.104.22.168 updated
30 seconds = 230MB
30 seconds after finished page load = 1.38GB
Firefox 41 Nightly 06-30-2015
AdBlock Plus Dev 22.214.171.124 updated
30 seconds = 236MB
30 seconds after finished page load = 263MB
plugin-container = 320MB
uBlock Origin v0.9.9.3 updated
30 seconds = 181MB
30 seconds after finished page load = 412MB
Firefox 41 Nightly 06-30-2015
uBlock Origin v0.9.9.3 updated
30 seconds = 196MB
30 seconds after finished page load = 368MB
uBlock still ends up using less RAM in the long run than ABP does but it’s nice to see that seriously drastic reduction in memory consumption because of that patch on today’s Nightly v41 – that’s quite impressive.
You enabled e10 for Adblock Plus with Nightly and disabled it with the other blocker.
You sould enable or disable e10 (plugin-container) for both.
I can’t help but notice you’re using the 32-bit version of Firefox on 64-bit Windows. Have you tried 64-bit Firefox (either for Nightly or Developer channel)? I’d be interested in your take on how that affects memory usage.
Andy, I have not tried it in a long while but plan to do so in the near future to find out about that.
These improvement come too late for someone who has switched from Adblock Plus to uBlock.
just test it again. Lazy is not a reason to don’t have the best software option.
Someone already did. You can scroll up in the comments to see.
uBlock still wins on memory usage as it lowers overall usage (by using less memory than the ads it blocks) while ABP still raises overall usage.
(Referenced in this post from a Mozilla Developer: https://blog.mozilla.org/nnethercote/2015/07/01/firefox-41-will-use-less-memory-when-running-adblock-plus/ )
I really don’t get it–not one other user using Rizone Firemin. So I am looking at 10-15 MB of memory with UBlock and no ABP; and 100 with UBlock and ABP. Why would I choose to not use a tool that is capable of reducing memory usage AND CPU usage so I can get along with doing what I am supposed to be doing on the Internet which isn’t checking memory consumption of one add-on. I think with 8GB of RAM or more, it really doesn’t matter in the Cosmic Mind what we do.
Oh my . . . .
Just to clarify, regular, document-level style sheets loaded via ‘style’ or ‘link’ elements in a page will not have their data shared across documents. That is a more difficult problem, but we plan to look at the feasibility of doing that. What the improvements that landed a couple of days ago help with is style sheets added at the user agent level (built in style sheets, such as those used for the default styling of HTML elements) or user level (which is where the userContent.css user style sheet is added, and where ABP adds its style sheet).
Cameron, thanks for the clarification. I have added part of it to the article to make things clearer.
I found version 41 is now in the Developer version as of 6/30/15 and it also contains the improvments. It also fixes many bugs I saw in version 40 which made it unusable for me. All in all a nice update. And I don’t use ABP but Ad Muncher.
It’s easier to just ditch Adblock Plus and use a decent ad blocker, like uBlock or Adguard.
I installed the Dev channel to get 41 to check the memory consumption (and multi-process) and I no longer have an Adblock Plus icon on my UI. It still shows in my list of installed extensions and appears to be active but no icon to turn it off or control it.
It was a bug that was fixed.
Try Adblock Plus latest development build.