by SloopJon · 12y ago · 0 comments
Activity Monitor reports that Firefox 32.0.3 is using 21 GB on my Mac. That makes for sluggish performance, even with 32 GB of RAM. Looking forward to trying Firefox 33.
If you ever see someone complaining about Firefox's memory usage, looking at about:memory is always the first step you should tell them to take. The amount of information can be overwhelming but in extreme cases like this it's often fairly obvious what the problem is -- look for the biggest measurement! And if it's still not obvious after that, communicating with Firefox developers (e.g. by filing a bug) usually results in progress happening.
There has to be a leak of some kind, but I don't know how to diagnose it. Activity Monitor has me at 756 MB right now, but it will creep back up over the next few days.
Nicholas Nethercote's blog[0] has many entries on memory, memory profiling &al as he's one of the big "memshrink" guys.
about:memory might be a good start, after reading his memshrink entries[1] and maybe contacting him.
Although the very first order of business is to check your extensions, extension leaks is the most common source of trouble (and has been for a long time). Disable everything, see what happens, then re-enable extensions one by one.
[0] https://blog.mozilla.org/nnethercote/
[1] https://blog.mozilla.org/nnethercote/category/memshrink/
Nope. It's more like 4 MiB per iframe.
ABP is a well-written extension, and I am 99.9% certain that it is not the cause of a Firefox instance taking up 21 GB of memory. Please don't spread misinformation.
I wonder how many iframes the average page has though, especially given Facebook like buttons and similar widgets. And someone like me, who maintains hundreds of tabs, could easily take up a few gigabytes of memory per addon, even if the amount of memory used for a single frame isn't that high.
I'm sure ABP was not the cause for the entire amount of memory in this case (or perhaps not at all), but many addons, each adding a bit of weight, can add up quickly.
http://www.reddit.com/r/programming/comments/25j41u/adblock_...
The only true fix is to remove it, although changing the ruleset and finding out which tab has humongous numbers of iframes is probably a good start: according to link 1 ABP has a static memory consumption of ~60MiB, plus 3~6MiB/iframe (since it's caused by the stylesheet size, I expect the precise ruleset impacts that)
It was implemented by the wonderful Jan de Mooij who just last week landed another nice JS memory improvement that should be released in Firefox 35: https://bugzilla.mozilla.org/show_bug.cgi?id=1073700#c7
Wow, that is just insane. Checking right now, it uses ~950MB for me on GNU/Linux. That's with 14 tabs (among which 2 that use flash player) and 20 active add-ons (gestures, self-destructing cookies, header modifier, adblock plus, etc.).
CPython did something similar (though more expansive, it switches between 4 different internal encodings depending on string content: ASCII, latin1, UCS2 and UCS4) in 3.3 with the PEP 393 "Flexible String Representation". I wonder if this Moz change was independently reinvented or inspired by the FSR.