Firefox using lots of memory? Adblock Plus may be the reason

Martin Brinkmann
May 14, 2014
Firefox
|
36

Mozilla has improved Firefox's memory usage significantly in recent time. Many Internet users still think that Firefox is using a lot of memory, but if you compare actual memory usage between different browsers, you will notice that Firefox's memory handling is excellent.

That does not mean that you may not see spikes in memory usage even if you open the same websites as someone else. One of the reasons for this discrepancy in memory usage are add-ons.

While many add-ons are memory efficient, others may increase the memory usage by a lot.

Mozilla recently analyzed memory usage of a version of Firefox without add-ons installed, and a version with the most popular add-on Adblock Plus installed.

The difference is significant, especially under the right circumstances. Adblock Plus adds an overhead to Firefox's memory usage of about 60-70 Megabyte. While that may be a lot depending on the installed memory on the computer, the difference can widen quickly under certain circumstances.

For every iframe that gets loaded in the browser, four additional Megabytes are added to the browser's memory usage. That does not appear to be much, but if you consider that some sites may make use of many iframes, it can grow quickly.

On the popular tech news site Techcunch for example, RAM usage more than doubles if the iframes on the website are activated.

The VIM Color Scheme Test page is an extreme example. Without Adblock Plus installed, Firefox uses about 370 Megabytes when the page is loaded. With Adblock Plus, that memory usage increases to almost 2000 Megabyte.

firefox high memory usage

Note: The test results of my own unscientific tests are the following: 188 Megybte and 300 Megabyte without Adblock Plus installed to 340 Megabyte and 1160 Megabyte respectively with it installed.

The main issue here is that the stylesheet that Adblock Plus uses for its functionality is loaded for each iFrame. If you are subscribed to Easylist or another large list, then this is the reason why the extension uses this much memory compared to vanilla Firefox installations.

Some users have created their own custom lists to reduce it by a large margin, but that is probably not a solution that most users are willed to consider as it takes some time to implement.

A bug has been filed on Bugzilla about Adblock Plus' high memory usage. It offers additional insight into why the memory usage goes up by that much under certain circumstances. There does not seem to be a solution though for that issue at the moment, other than creating and using custom filter lists exclusively that use less information and are therefore considerably smaller in size.

Summary
Firefox using lots of memory? Adblock Plus may be the reason
Article Name
Firefox using lots of memory? Adblock Plus may be the reason
Description
The popular browser add-on Adblock Plus may increase Firefox's memory usage significantly under certain circumstances.
Author
Advertisement

Tutorials & Tips


Previous Post: «
Next Post: «

Comments

  1. charles smith said on June 8, 2018 at 9:29 am
    Reply

    Yes u r right there are many adblockers who are using a lot of memory. Its not just about the memory they are also killing the online advertisement business. so we have to find some way to beat those ad blockers. so i tried adzsafe.

  2. Gary Quiring said on September 11, 2014 at 5:20 pm
    Reply

    It’s not AdBlock Plus. I removed the extension, restarted Firefox and everything looked fine, I was at about 465meg. Started browsing sites and about 3 hours later Firefox is using up 1.7gig of memory.

    My extensions are TMP, LastPass, The Tracktor, BluHell Firewall, Search for Image by Google, Flash video downloader and Google translator.

  3. Joe said on May 28, 2014 at 10:16 am
    Reply

    I’d like to try this because I’ve been experiencing NUMEROUS Firefox crashes over the last month or so which I now suspect after reading this and similar articles are related to AdBlock Plus memory overconsumption, but I don’t know how to install the scripts into Firefox. Can you walk me through that?

  4. Zsolt said on May 26, 2014 at 4:06 pm
    Reply

    @gorhill
    Okay. How do I use it to block ads then?

  5. gorhill said on May 24, 2014 at 5:46 pm
    Reply

    > There does not seem to be a solution though for that issue at the moment

    There is a solution: https://github.com/gorhill/httpswitchboard/wiki/Adblock-Plus-memory-consumption

    I implemented it in HTTPSB. Works well. It would also work on Firefox, solution is not specific to Chromium.

    1. Zsolt said on May 24, 2014 at 6:40 pm
      Reply

      Stupid question, but how does it work? What’s the connection with Adblock Plus? Does it replace adblock plus or it works with it?

      By the way I only see “A Chromium browser extension[…]” without any reference to firefox. And I don’t see .xpi files in the dist folder. How is it connected to firefox?

      1. gorhill said on May 25, 2014 at 7:57 pm
        Reply

        > Stupid question, but how does it work?

        It injects only the CSS rules which are going to be really used by the page, instead of injecting unconditionally all of them (20,000).

        > What’s the connection with Adblock Plus?

        None.

        > How is it connected to firefox?

        The solution is written in javascript, and it’s based on common sense, not based on a specific browser.

  6. Zsolt said on May 21, 2014 at 8:59 pm
    Reply

    Too bad there aren’t any full alternatives.

  7. Tehmul Ghyara said on May 16, 2014 at 9:56 am
    Reply

    Ghostery does a reasonably good job of removing ads.

  8. Boris said on May 16, 2014 at 3:24 am
    Reply

    Adblock is guilty, but Flash plugin is a real enemy. Each tab with simple flash allocates additional 50MB. Tab with flash video allocates at least 100MB. And if you open pages with 10 Youtube videos in in, forget about it. It will take all the memory you have.

    Also check other extensions. I found one really needed one that is also huge memory hog(probably conflicting with something else).

  9. Gabe said on May 15, 2014 at 4:04 pm
    Reply

    I wonder if Adblock Edge (the Adblock without whitelist crap etc) is affected too. My FF consumes about 900mb at the moment, with about 30tabs open.

    1. Martin Brinkmann said on May 15, 2014 at 4:16 pm
      Reply

      It is likely similar. I would check the example pages with the add-on enabled and disabled.

      1. Gabe said on May 15, 2014 at 5:00 pm
        Reply

        Yes, exactly the same sadly.

  10. Mountainking said on May 15, 2014 at 7:25 am
    Reply

    Tried to post yesterday but the anti spam or something kept me out.
    To rephrase what I said…
    I think it would add more value if you compare Chrome loading the website with and without adblock so that people can benchmark if firefox memory management is still bad. As it looks, without another browser to benchmark against, the article seems to imply that the culprit is adblock.
    It could be firefox’s management of extensions is poorly implemented or something.

  11. sergeanthasan said on May 15, 2014 at 6:16 am
    Reply

    I just download Flashblock from Firefox so severe that I can not play vedeo / youtube in firefox browser, totally useless

    1. Mountainking said on May 15, 2014 at 9:15 am
      Reply

      After such a comment, I think you would be better off deleting your RAM :)

  12. Karl Gephart said on May 15, 2014 at 1:09 am
    Reply

    I cast ABP aside well over a year ago for Bluhell for being a GROSSLY HUGE memory hog. I realized this at the time when I ran the addon, about:memory-addons to prove this. To me, not being able to whitelist in Bluhell is not a big thing when you consider Bluhell is awesome for blocking YouTube and other video ads in addition to image ads.

  13. Dave said on May 15, 2014 at 12:16 am
    Reply

    What I’d like is a simple list that blocks Facebook and other social trackers, while letting me use the Facebook site if I want to. Ghostery was good, but there must be alternatives. Right now I have Disconnect which I find poor by comparison.

  14. SCBright said on May 14, 2014 at 11:40 pm
    Reply

    Not really, my Firefox with ABP and a lot of extensions installed use only 476Mb of memory.

  15. Dwight Stegall said on May 14, 2014 at 8:47 pm
    Reply
  16. jasray said on May 14, 2014 at 7:51 pm
    Reply

    Okay, so I am still running that old, funky Firemin and Palemin software. No memory problems, and no CPU problems. Wondering why other are apparently not using it. Is it NSA spyware?

  17. Tommy said on May 14, 2014 at 6:48 pm
    Reply

    Thank you dszady for the link to about:addons-memory works well, with simple layout of info even i can understand, cheers!

  18. Marc Falck said on May 14, 2014 at 6:45 pm
    Reply

    Duh doy…

    I always found it laughable to see these people with 2+ huge adblock subscriptions turn around and complain about Firefox cpu/memory “leaks”.

  19. Ray said on May 14, 2014 at 5:40 pm
    Reply

    Yeah, Adblock Plus uses a lot of memory because of subscription lists.

    If you have the “Count filter hits” option in enabled in Adblock Plus, take a look at what rules actually get fired. In my case, the ones that get fired over and over again make up only 4% of the total rules in Easylist and EasyPrivacy.

    I have always contemplated making my own subscription list based on that 4%, but the worry is missing future rules that may block other stuff.

    Here’s a comment from one of the blog posts Martin linked to detailing how to remove all the excess rules from an Adblock subscription list:
    https://blog.mozilla.org/nnethercote/2014/05/14/adblock-pluss-effect-on-firefoxs-memory-usage/comment-page-1/#comment-11195

    This is something I might try in the future.

    1. Ray said on January 4, 2015 at 9:56 pm
      Reply

      Just to confirm my theory, a user on the Adblock Plus forums trimmed down the rules on his subscription list to the bare minimum (rules that hit greater than 10 times) and memory usage decreased big time:
      https://adblockplus.org/forum/viewtopic.php?p=103697&sid=b949af962bf6e99c398db27f98592e3d#p103697

      Granted, this was on ABP for Android, but same principle applies.

      I use uBlock on Firefox and Chromium now, but just wanted to post this tidbit here.

    2. Pants said on May 14, 2014 at 8:40 pm
      Reply

      Well, I’ve been using AdBlock Plus (in this portable FF) since I set it up about 2 years ago – and I do not clean out extension data when “cleaning” .. and I sorted Easylist by hits .. and I’ve NEVER had any (although I did “reinstall it” (never removed it) the other day when testing Privacy Badger as I thought I has lost the toolbar icon, so that *may* have reset any counts). I actually have the setting for show a placeholder enabled and I must say, I’ve never seen one of those either.

      I guess I nail everything before it gets thru to my browser (local proxy: privoxy) and if it gets past that, then RequestPolicy would kill it dead if it was third party – and then perhaps other extensions block it before AdBlock Plus (maybe NoScript gets there first?).

      I didn’t delete any items as you suggested – instead I have disabled EasyList (but left the Popup BlockList and my own custom filter of 10 items). Results: FF newly opened went from 400mb with filter to 360mb without. It did indeed seem to open faster.

      Interesting .. hmmm… as I was typing this I thought I would check something. I have a temperature monitoring in my system tray – and I know for a fact when I to Facebook, my machine makes more noise and my temp rises an extra 10 degrees. Without the EasyList filter – I just loaded FaceBook (my normal custom list landing page) and no noise, MUCH faster loading. Same for amazon – it would always takes a while to load eveything, machine would start being noisy (in my enclosed server cabinet) and the temps would jump 10 degrees. Now’s it as quiet as a mouse. Additionally my computer at “rest” is now 3 degrees cooler on average. Clearly, AdBlock Plus chews thru resources – appreciably slowing complex sites with many ads/wdigets/whatever such as amazon/FB.

      I will leave EasyList disabled and while I will keep an eye out, I doubt I will see any difference in what lands in front of my eyeballs.

      As for memory leaks – never seen them. I happily leave FF open for weeks at a time and would be lucky to have 2 crashes a year :)

      Thanks Martin – you may have an extra dollop of ice cream tonight :)

      1. Pants said on May 15, 2014 at 8:54 am
        Reply

        ^^^ Update: AdBlock Plus wipes all my filters hits on every shutdown/open of FF. I noticed one “ad” earlier on a site I visit every day (hence the “ad” stuck out). So I loaded the EasyList and voila it vanished and I had a hit. I loaded facebook, 8 more hits (“/hads-“). Closed/opened FF – all hits were back to zero.

        Have since re-enabled EasyList. Never really had any problems with it anyway – but it’s interesting that I also have ABP in thunderbird and its also been incorporated into QuiteRSS – and they don’t have any problems either.

  20. dszady said on May 14, 2014 at 5:23 pm
    Reply

    Some of you may already have this but for those that don’t:
    https://addons.mozilla.org/en-US/firefox/addon/about-addons-memory/

    From the add-on page:
    “About this Add-on
    about:addons-memory provides an experimental about: page for advanced users to display some memory usage statistics about their add-ons.

    To use, open about:addons-memory in a new tab.”

    1. Pants said on May 15, 2014 at 8:59 am
      Reply

      ABP = 13.56 MB usage, 17.5% addons, 3.4% (explicit)

      Its listed at numero duo (after FF itself), and that’s out of some 80 or so addons loaded. Next highest are
      – DoNotTrackMe : 3.91Mb
      – Ghostery : 2.41Mb
      – NoScript : 1.71Mb

  21. WCS.Tony said on May 14, 2014 at 5:22 pm
    Reply

    I found that AdBlock plus was rather a problem on old XP machines with limited memory.
    Now don’t get me wrong I LOVE AdBlock Plus but some of my customers could not afford a memory update so I searched for a solution. I tried several cut down versions of AdBlock but eventually settled for BlueHell Firewall which is not quite as good as AdBlock Plus, but good enough at blocking adverts, and it uses far less memory.

  22. Tommy said on May 14, 2014 at 4:37 pm
    Reply

    Have used adblock plus for many years and noticed that recently my surfing was slow plus firefox was slow to start first thing. So i fully uninstalled ABP and tried Adblock Edge but had the same problem, both used easylist and fanboys annoyance list by the way, but later found that i had unticked iframe box in NoScript ( i could not read youtube comments with it on) allowing NoScript to block iframes seems to help a little about 30MB, with startup a little faster on my homepage.

  23. Maelish said on May 14, 2014 at 4:26 pm
    Reply

    Your conclusions aren’t off the mark. Unfortunately the memory footprint seems to grow by the hour. If I use firefox, it must be shutdown and restarted with regularity because of adblock.

    @Sades – Going to try Bluhell, I hadn’t seen it before.

  24. mazling said on May 14, 2014 at 3:59 pm
    Reply

    I’ve also noticed that adblock can reduce the framerate of flash videos for me. Perhaps my computer is slow, but I tried disabling (in addons manager) my own adblock and got smoother video from youtube. Disabling flash and switching to html5 video is even better and it seems unaffected by adblock.

    1. jasray said on May 14, 2014 at 7:49 pm
      Reply

      Bluhell blocks an interesting site on this network: outlook.com.

    2. red said on May 14, 2014 at 7:24 pm
      Reply

      I’ve heard this uses more CPU instead of memory. So it’s a bit of a trade off if that’s the case.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.