Mathias Hasselmann

Firefox 6 Memory Usage

Firefox 6 landed on my Ubuntu box, so obviously it's time for my mandatory Firefox rant...

top - 14:42:13 up  4:24,  7 users,  load average: 6.52, 4.21, 1.83
Tasks: 216 total,   4 running, 211 sleeping,   0 stopped,   1 zombie
Cpu(s):  5.0%us,  8.5%sy,  0.2%ni, 17.3%id, 69.1%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   3951008k total,  3915284k used,    35724k free,     2500k buffers
Swap:  4001788k total,  1353916k used,  2647872k free,   335360k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                
16775 mathias   20   0 5454m 2.8g  16m S    0 73.3   3:21.52 firefox-bin

This is with 6 tabs open: Bugzilla, Google, nothing heavy. Not funny at all.

Maybe a Firefox bug, more probably Ubuntu messing up with patching under time pressure.

Anyway: Time to read about quality management, to consider how mixing security fixes with feature releases impacts release quality, to consider how rushing releases impacts release quality.

Sorry for sounding arrogant while pointing out the obvious.

Update: Resetting layers.acceleration.force-enabled did the trick.


glandium commented on August 17, 2011 at 10:57 p.m.

Watch about:memory

Some Dude commented on August 17, 2011 at 11:21 p.m.

After checking about:memory, check out because it's good news.

One of the great things about frequent releases is that the memory fixes mentioned in the above blog have landed in Firefox 7 and will be with you soon.

Although Firefox is not great, it's not THAT bad (your 2.8GB process) so something is obviously wrong here. Please install a 7 nightly and post your about:memory to bugzilla.

Mathias Hasselmann commented on August 17, 2011 at 11:30 p.m.

Thanks for the hints, watching about:memory

Peter commented on August 17, 2011 at 11:39 p.m.

I've had dozens of tabs with BZ and google. What addons do you have? It sounds more like a rouge addon rather than firefox itself!

Mathias Hasselmann commented on August 17, 2011 at 11:43 p.m.

Main Process

Explicit Allocations
1,015.72 MB (100.0%) -- explicit
├────927.04 MB (91.27%) -- heap-unclassified
├─────72.71 MB (07.16%) -- js
│ ├──61.00 MB (06.01%) -- gc-heap
│ ├───7.75 MB (00.76%) -- mjit-code
│ └───3.96 MB (00.39%) -- (3 omitted)
├──────7.88 MB (00.78%) -- storage
│ └──7.88 MB (00.78%) -- sqlite
│ └──7.88 MB (00.78%) -- (14 omitted)
├──────5.13 MB (00.51%) -- images
│ └──5.13 MB (00.51%) -- (2 omitted)
└──────2.97 MB (00.29%) -- (1 omitted)

Other Measurements
1,884.60 MB -- vsize
1,079.00 MB -- heap-committed
1,007.72 MB -- heap-used
874.17 MB -- resident
71.28 MB -- heap-unused
2.81 MB -- heap-dirty
0.10 MB -- gfx-surface-image

Seems like some C++ code runs amok? Anything in the tool chest to trace heap-unclassified usage, or is this time for valgrinding?

Peter commented on August 17, 2011 at 11:48 p.m.

Check out the memshrink team, they have a weekly blog with massive amounts of detail

Mathias Hasselmann commented on August 17, 2011 at 11:49 p.m.

Peter: Even have that problem after disabling all addons. :-/ Checking official binaries from (why is the 64 bit version that hidden). Guess I also should try with an entirely new profile.

Mathias Hasselmann commented on August 17, 2011 at 11:50 p.m.

Just a few moments later:

Main Process

Explicit Allocations
1,872.07 MB (100.0%) -- explicit
├──1,768.02 MB (94.44%) -- heap-unclassified
├─────76.96 MB (04.11%) -- js
│ ├──60.00 MB (03.21%) -- gc-heap
│ ├──11.70 MB (00.62%) -- mjit-code
│ └───5.27 MB (00.28%) -- (3 omitted)
├─────19.90 MB (01.06%) -- storage
│ └──19.90 MB (01.06%) -- sqlite
│ ├──16.24 MB (00.87%) -- places.sqlite
│ │ ├──15.84 MB (00.85%) -- cache-used
│ │ └───0.40 MB (00.02%) -- (2 omitted)
│ └───3.66 MB (00.20%) -- (13 omitted)
└──────7.19 MB (00.38%) -- (2 omitted)

Other Measurements
2,785.93 MB -- vsize
1,892.00 MB -- heap-committed
1,860.00 MB -- heap-used
1,531.48 MB -- resident
32.00 MB -- heap-unused
2.39 MB -- heap-dirty
0.09 MB -- gfx-surface-image

Jeremy Bicha commented on August 18, 2011 at 12:59 a.m.

I suggest you also try firefox -ProfileManager and see if you can duplicate with a clean profile.

Obviously, Firefox 6 does not use 2GB for normal users with only a few tabs open. So something is going wrong on your computer.

I happen to have 233 tabs open now in Firefox 7 with only 1GB resident memory. I definitely need to close some tabs but still...

Firefox 6 should be better at memory than Firefox 5 which was better than 4. For me, these new updates are improving with better control against regressing than the previous annual (or so) massive update.

Mathias Hasselmann commented on August 18, 2011 at 1:19 a.m.

For whatever reason layers.acceleration.force-enabled was set to true. Resetting this setting seems to repair memory consumption.

Jeff Walden commented on August 18, 2011 at 10:34 a.m.

It's worth pointing out in response to "rushing releases impacts release quality" that the last substantial changes Firefox 6 saw occurred a few months ago. (I want to say near May 20, which would be six weeks after the Firefox 5 freeze I definitely remember being near April 10, but I haven't checked.) So for about the last three months, the code's only seen stability and security fixes. How much more time stabilizing do you believe it would take to not rush releases?

I don't actually know that three months is sufficient bake time, to be sure. Maybe more is required, perhaps. I do think it important to clarify that despite a more rapid release schedule, there's a good deal of lag built in to ensure time for things to stabilize, and for regressions to be fixed -- much more than the time between 4 and 5, 5 and 6, or 6 and 7 might lead you to believe.

Sense Hofstede commented on August 18, 2011 at 1:21 p.m.

Please be aware that the Firefox release pushed through Ubuntu's repositories is not compiled with profile optimisation, but the tarballs you can download from the official site are. That is an important difference performancewise.

simeon commented on August 18, 2011 at 5:11 p.m.

you know what is also sad:
ps axv
11613 ? Rl 0:17 67 221 342206 28008 0.7 gnome-system-monitor

Benjamin Otte commented on August 18, 2011 at 9:55 p.m.

I'd think that Firefox is the best-tested part of software that you run on your computer. That doesn't mean you're not allowed to flame them, but if I were you, I wouldn't do it without a good and reasonably-researched reason.
But you figured that out already :)

Kudos to you for pointing it out, too.

Ryan Sharp commented on August 19, 2011 at 7:03 p.m.

I strongly suggest switching to Fedora. Ubuntu just don't have enough talent to engineer a stable distro. They barely ever actually write code - they just patch, package and market.

The Fedora guys are balls deep in the code they package and their deep understanding of it really reflects in the overall quality of their releases. Ubuntu just take people's work, break it with their awful patches and then take all the credit for the entire effort.

PulseAudio is a great example. The Fedora guys put in all the hard work to create it. Then the Ubuntu idiots decide to use it, break it with their usual clueless patching and then proceed to complain about how poorly designed and broken it was. Of course, they only had their own stupidity and lack of coding chops to blame, since no one at Canonical actually knows how to write software.

The complaining also extended into their (mostly retarded) community, where the flavour of the month became PulseAudio bashing (and later Lennart Poettering bashing).

Unless Ubuntu starts hiring some real developers, instead of just marketers, they'll never be much more than buzz and hype. People know who gets the real work done. There's only so much Ubuntu can differentiate themselves with trivial, unskilled patching of everyone else's hard work.

Jeremy Bicha commented on August 20, 2011 at 9:45 a.m.

Ryan, your Fedora-Ubuntu rant is rather off-topic as this bug has nothing to do with what Linux distribution is being used.

Mathias Hasselmann commented on August 21, 2011 at 7:09 p.m.

Ryan your Ubuntu rant indeed is off topic, buight know me I enjoy picking up off-topic discussions:

Situation in Linux desktop land is really sad right now. Redhat has the programmers, Ubuntu spends money on UX designers. Both is important, but in the end it seems the additional UX polish gives Ubuntu the final advantage to win users. Really would love to see Canonical teaming up to build a true contenter. Still might be more easy for Redhat to finally invest a few bucks into a few serious UX designers with prooven professional track. Having worked with some professional UX designers at Nokia I know for sure that excellent UX design takes much more than being a brilliant illustrator.

Ryan Sharp commented on August 21, 2011 at 11:11 p.m.

If his speculation that "...maybe a Firefox bug, more probably Ubuntu messing up with patching under time pressure" is true, then it actually is somewhat on topic.

When Ubuntu can't even patch things properly and persistently break everything they touch - that's pretty relevent to most people who happen to be using their worthless distro.

Jeremy Bicha commented on August 21, 2011 at 11:50 p.m.

Except that this bug wasn't caused by a Ubuntu patch.

I appreciate that you like Fedora & think Red Hat developers are great coders, but please take your hatred of Ubuntu somewhere else. If Ubuntu is as awful as you imagine, then I'm sure Fedora's market share will go up significantly in the next year or two without your name-calling.

Mathias Hasselmann commented on August 22, 2011 at 1:05 a.m.

Thank you Jeremy, couldn't have said this better.

Dao commented on August 23, 2011 at 5:40 p.m.

It's always refreshing to read your updates that render your rants entirely useless. Looking forward to the next one. :)

Mathias Hasselmann commented on August 23, 2011 at 6:42 p.m.

Dao: So you think it's ok if software suddenly turns into a children eating monster after an update? Also I still don't know why layers.acceleration.force-enabled was set to "true" and why Firefox didn't reset or ignore that setting if that feature is entirely broken.

Dao commented on August 23, 2011 at 8:03 p.m.

There's a reason why Firefox warns you when opening about:config. If you don't know what you're doing, don't mess with hidden preferences.

And no, Firefox didn't magically set layers.acceleration.force-enabled to true -- it's something you must have done.

t0m5k1 commented on August 28, 2011 at 5:13 p.m.

man some people go off topic of comment on the blog runner's post's in such a negative fashion makes me wonder why they browsed here in the first place still trolls live under digital bridges which most of us higher mortals merely walk over so i guess the world requires some river cleaners, just wish they would stfu lol

Mathias thank you for posting this it opened my eye's to the area's of FF mem munching that i had forgotten about :)

t0m5k1 commented on September 12, 2011 at 11:29 a.m.

thnx for deleting that rather nasty & abusive comment from a rather unhappy Ryan.

i really do not care if you know me & tbh if you do know me then what happened to your kutspa to actually come say something to me personally lol i mean you are in the UK so come find me lol