Testing extensions for memory leaks on Trunk.

Recently I’ve been investigating extensions and whether any cause memory leaks on Firefox Trunk builds. The two things I am most interested in are:

  • Do any of the popular extensions leak memory?
  • Do any extensions that leak memory do so on Trunk but not Branch?
  • The first point is common sense; an extension leaking memory can make firefox look bad and could lead to problems whilst browsing. The second point is more interesting, since it could indicate a problem with the new XPCOM Cycle Collector.

    Of course there are serious limitations as to what one guy can test. There are 1000s of extensions available for firefox, there are many different codepaths within a single extension and there is also the possibility of memory leaks caused by the interplay between two or more extensions. Thusly, my scope for these tests was quite small; I individually tested the top 20 extensions listed on AMO plus a few of the extensions that I personally use.


    For testing I was using Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a7pre) Gecko/2007071803 Minefield/3.0a7pre ID:2007071803, a new profile and had extensions.checkCompatibility set to false to allow the installation of extensions that would not otherwise install on trunk builds. I installed one extension at a time and then tried using it, setting different options and generally screw around on firefox for a while. Then firefox would get closed and the nspr.log analysed for leakage. In these brief tests, I was unable to make the following extensions leak:

  • VideoDownloader 1.1.1
  • Adblock Plus 0.7.5.1
  • Greasemonkey 0.7.20070607.0 (No scripts installed)
  • PDF Download 0.8.1
  • FoxyTunes 2.9.2
  • DownloadThemAll! 0.9.9.10
  • FasterFox 2.0.0
  • ColourfulTabs 2.0.6
  • StumbleUpon 3.06 (Not really tested, registration required)
  • DownloadHelper 2.3.2
  • TabMixPlus Dev Build 0.3.6.0.070714
  • Foxmarks Bookmark Synchronizer 1.0.1 (Not really tested, registration required)
  • Autohide 1.1.5
  • MediaPlayerConnectivity 0.8.3
  • Nuke Anything Enhanced 0.54
  • Paste & Go 0.8
  • FireFTP 0.97 (I don’t think this was working properly on trunk anyway, so not tested really)
  • All-in-1 Gestures 0.18 (Sorry Daniel, couldn’t get this to leak!)
  • So with my testing I could not get leak-gauge.pl to report any memory leakage with these 18 extensions. (Disclaimer still applies: I couldn’t possibly test all code-paths and extension interplay could perhaps cause memory leakage!) Now onto what I did find:

  • IE Tab 1.3.3.20070528 was found to still be leaking on trunk and branch (and didn’t work consistantly on trunk either). The memory leak part of this is filed as Bug 324793.
  • ForecastFox 0.9.5.2 was found to leak 2 DOM Windows on trunk, but nothing on branch. Filed as Bug 388573.
  • FoxClocks 2.1.93 was found to leak various DOM Windows when going into one of its options screens on Trunk; no leakage was observed with Branch. Filed as Bug 388577
  • Web Developer 1.1.4 was found to leak DOM Windows under some circumstances on trunk, but not on branch (eg: CSS > Edit CSS) but I believe this is because the extension is not properly compatible with the trunk. (Trying to close the UI element that appears when doing CSS > Edit CSS results in nothing happening on trunk); nothing filed on this yet.
  • NoScript 1.1.6.02 and FlashGot 0.6.1 were both found to leak 2 DOM Windows on trunk builds but not on branch builds. The extension author, Giorgio Maone, has been informed and he is investigating. The root cause of this issue may be the same thing that is causing ForecastFox 0.9.5.2 to leak 2 DOM Windows on trunk but not branch. Nothing filed until Giorgio figures out what is going on or I retest if Bug 388573 gets fixed.
  • FireBug may or may not have shown leakage. I think not, but it was hard to work out if it did because of bugs like bug 388297, so when that gets fixed I will take another look.
  • And that concludes my testing. A good result considering the massive changes that the XPCOM Cycle Collector made.

    12 Responses to “Testing extensions for memory leaks on Trunk.”

    1. Ray Kiddy Says:

      Did you file bugs? Do you plan on doing this again?

    2. Ray Kiddy Says:

      Ah. i see you did file bugs. :-)

    3. Gérard Talbot Says:

      Steve,

      2 memory leakages where found in previous versions of FireFTP (v. 0.94.6) and then fixed:

      https://www.mozdev.org/bugs/show_bug.cgi?id=16409#c1

      Obviously, a more systematic examination of all extensions worth using should be done.

      Regards,

      Gérard
      P.S.: Your webpage is so dark that I had to neutralize, override the colors in order to figure out how to reply.

    4. Ian Says:

      A while back I suggested that Mozdev add the ‘mlk’ keyword for memory leak bugs. There are currently 11 open ones labelled as such, some of which definitely still leak after all this time (e.g. Sage):

      https://www.mozdev.org/bugs/buglist.cgi?keywords=mlk

      It would be great if Mozilla could help out with these leaks in some situations.

    5. Gérard Talbot Says:

      Ian, the keywords like mlk can be added to a mozdev bug report, but only the reporter or assignee.

      Add to the list of resolved memory leakage bug reports at mozdev for Firefox add-on extensions (but without a mlk keyword):

      FlashBlock 1.5.1
      https://www.mozdev.org/bugs/show_bug.cgi?id=14013

      Steve, I wish you could make your website/webpage easier to use (referring to colors used, color brightness, color contrast) and also pass validation markup compliance.

      Hints:
      https://bugzilla.mozilla.org/show_bug.cgi?id=373495

      http://validator.w3.org/check?uri=http://steveengland.wordpress.com/2007/07/18/testing-extensions-for-memory-leaks-on-trunk/

      Visit
      http://www.mozilla.org/access/authors
      and then search for color contrast, color brightness:

      “Contrast is the perceived difference between two adjacent colors. (…) Contrast is extremely important in Web design.”
      Wheel of Color: Pump up the Contrast, Robert Hess, MSDN

      “For this year’s list of worst design mistakes, (…) I asked readers of my newsletter to nominate the usability problems they found the most irritating. (…) about one-third complained about *_low contrast between text and background_*.”
      Top Ten Web Design Mistakes of 2005: 1. Legibility Problems

      Respectfully and regards,

      Gérard Talbot

    6. Daniel Luz Says:

      Oh, I only learned of this post today, on Jesse Ruderman’s blog…

      That’s too bad about AIO, I’ll see if I can find anything (that if it still leaks on Minefield). It seems somebody else also found it to be leaking, so at least I’m not seeing illusions :) https://addons.mozilla.org/en-US/firefox/discussions/comments.php?DiscussionID=3907&page=1#Item_0

    7. Steve England Says:

      Thanks for the feedback Gérard! I’ll look at the other default themes and see if there’s something more usable.

    8. alanjstr Says:

      Its great that you’ve been testing addons. If you blog about Mozilla stuff often, maybe you should get listed on http://gemal.dk/mozilla/blogupdates.html . That’s where I go for my news summary.

    9. Jonah Bishop Says:

      Can you shed some light on *how* you tested these extensions? For example, what was the setup process you went through? I’ve got a couple of extensions that I’ve written, and I’d like to check them for leaks just to make sure I’m doing things the right way. Thanks in advance!

    10. Steve England Says:

      Hi Jonah. I’m not sure how much I can expand on what I already wrote about how I tested the extensions: “I installed one extension at a time and then tried using it, setting different options and generally screw around on firefox for a while. Then firefox would get closed and the nspr.log analysed for leakage.”

      I basically tried to use the extension for what it was intended (downloading videos, say, or removing page elements, or whatever). There was no scientific approach to the test, just one guy trying various extensions and seeing if he could catch a leak somehow.

    11. links for 2007-10-16 « Mandarine Says:

      [...] Testing extensions for memory leaks on Trunk Thusly, my scope for these tests was quite small; I individually tested the top 20 extensions listed on AMO plus a few of the extensions that I personally use. (tags: firefox extensions) [...]

    12. Get Firefox Now » Firefox Memory Leaks. Says:

      [...] England tested the top 500 web sites, finding two leaks. Later, he tested the top 20 Firefox extensions and found leaks in several of [...]

    Leave a Reply