Categories
Fennec Firefox Garbage Collection Memory consumption MemShrink

MemShrink progress, week 19

Good News

Peter Van der Beken fixed a leak caused by chrome code that injects a function into pages.  This was a MemShrink P1 bug.  The commentary in the bug is confusing, but this may have been affecting numerous add-ons including Firebug. (Bug 669730 is open for tracking leaks in Firebug;  it hasn’t yet been confirmed whether this fix has helped Firebug.)

Andrew McCreight rewrote JS_DumpHeap so that it dumps the complete JS object graph.  This was a MemShrink P1 bug because it’s an important piece of infrastructure for writing leak detection tools.

Justin Lebar fixed the measurement of RSS on Mac.  This was a MemShrink P1 bug because it prevented us from enabling jemalloc on Mac 10.5 machines.

Brian Hackett tweaked the JS engine so that more method JIT code can be discarded periodically, particularly chrome code in system compartments.

Oleg Romashin avoided using transparent layers in Fennec remote offscreen viewports.  This saves 5MB of memory in the active tab.

I added a memory reporter for the startup cache.  This is often around 1MB of memory, but it’s allocated via mmap/VirtualAlloc and so doesn’t change the “heap-unclassified” number in about:memory.

Boris Zbarsky fixed a small leak involving CSS transforms.

Bad News

It appears a bad memory regression has occurred in the past week or so.  Several people have reported multi-second pauses caused by garbage collection and cycle collection.  The problem only seems to strike when many tabs are open and/or the browser has been running for multiple days.  This needs investigation;  if you are experiencing similar problems please report in the bug.  Reliable steps to reproduce this bug will be invaluable.  If you turn on javascript.options.mem.log in about:config you can see when GCs and CCs occur and how long they take, which is helpful for diagnosis.

Bug Counts

The current bug counts are as follows.

  • P1: 35 (-5, +3)
  • P2: 113 (-3, +8)
  • P3: 54 (-0, +1)
  • Unprioritized: 4 (-5, +3)

I want to point out this bug, which presents an idea to help hunt down reproducible leaks that occur when users have multiple add-ons present.  This is important because many of the leaks reported by users recently are due to add-ons, but often the reporter has many add-ons installed which makes finding the culprit painful.  The goal is to write a Firefox add-on that selectively disables installed add-ons, so that a user can bisect them to discover which add-on is responsible for the leak.  This bisecting process is something that people can do manually, but an add-on that automates the process would make things easier and less error-prone.  Mercurial’s ‘hg bisect’ command would serve as a useful comparison.  Ehsan Akhgari has volunteered to mentor anyone who would like to try to implement this.

 

11 replies on “MemShrink progress, week 19”

I think i am one of the few whom had been affected from the bad news. I will post further information once i am back home.

Another thing i wanted to point out was how much of these leaks, and memory usage are JS related. It has got to the point we are more like running JS VM then a Browsers!

I have recently turned off JS in Firefox and to my surprise I have such a nice browsing experience!. Everything is fast, no memory hogging, scrolling is fast as well. Apart from few site that heavily rely on JS such as Gmail, RSS Reader, Twitter and Facebook.

Below is the About:Memory when i had 60 tabs running, JS Disabled.

297.03 MB (100.0%) — explicit
├──104.86 MB (35.30%) — heap-unclassified
├───58.54 MB (19.71%) — storage
│ └──58.54 MB (19.71%) — sqlite
│ ├──41.29 MB (13.90%) — places.sqlite
│ │ ├──40.98 MB (13.80%) — cache-used [4]
│ │ └───0.31 MB (00.10%) — (2 omitted)
│ ├──14.67 MB (04.94%) — urlclassifier3.sqlite
│ │ ├──14.59 MB (04.91%) — cache-used
│ │ └───0.08 MB (00.03%) — (2 omitted)
│ └───2.57 MB (00.87%) — (8 omitted)
├───56.87 MB (19.15%) — js
│ ├──22.55 MB (07.59%) — compartment([System Principal], 0x317b000)
│ │ ├──14.65 MB (04.93%) — gc-heap
│ │ │ ├───8.14 MB (02.74%) — objects
│ │ │ ├───5.18 MB (01.74%) — shapes
│ │ │ └───1.32 MB (00.45%) — (5 omitted)
│ │ ├───2.06 MB (00.69%) — string-chars
│ │ ├───1.89 MB (00.64%) — object-slots
│ │ ├───1.74 MB (00.59%) — scripts
│ │ ├───1.57 MB (00.53%) — property-tables
│ │ └───0.64 MB (00.22%) — (2 omitted)
│ ├──14.81 MB (04.99%) — (56 omitted)
│ ├───9.95 MB (03.35%) — gc-heap-chunk-dirty-unused
│ └───9.56 MB (03.22%) — compartment(http://www.google.com/reviews/polls/disp…)
│ ├──8.18 MB (02.75%) — gc-heap
│ │ ├──4.14 MB (01.39%) — objects
│ │ ├──3.84 MB (01.29%) — shapes
│ │ └──0.19 MB (00.07%) — (3 omitted)
│ └──1.38 MB (00.47%) — (3 omitted)
├───46.11 MB (15.52%) — layout
│ ├──31.17 MB (10.49%) — arenas
│ └──14.94 MB (05.03%) — styledata
├───14.19 MB (04.78%) — images
│ ├──14.00 MB (04.71%) — content
│ │ ├──14.00 MB (04.71%) — used
│ │ │ ├──10.20 MB (03.43%) — raw
│ │ │ ├───2.16 MB (00.73%) — uncompressed-nonheap
│ │ │ └───1.65 MB (00.56%) — uncompressed-heap
│ │ └───0.00 MB (00.00%) — (1 omitted)
│ └───0.19 MB (00.06%) — (1 omitted)
├───12.83 MB (04.32%) — dom
├────2.21 MB (00.74%) — spell-check
└────1.43 MB (00.48%) — (3 omitted)

And JS Enabled, Slow, some times unresponsive……..

1,013.91 MB (100.0%) — explicit
├────596.98 MB (58.88%) — js
│ ├───91.17 MB (08.99%) — (85 omitted)
│ ├───65.26 MB (06.44%) — compartment(http://www.facebook.com/plugins/like.php…)
│ │ ├──28.56 MB (02.82%) — gc-heap
│ │ │ ├──16.68 MB (01.64%) — objects
│ │ │ ├──11.43 MB (01.13%) — shapes
│ │ │ └───0.45 MB (00.04%) — (4 omitted)
│ │ ├──18.31 MB (01.81%) — scripts
│ │ ├──10.00 MB (00.99%) — mjit-code
│ │ └───8.40 MB (00.83%) — (6 omitted)
│ ├───34.95 MB (03.45%) — compartment([System Principal], 0x317e000)
│ │ ├──20.10 MB (01.98%) — gc-heap
│ │ │ ├──11.60 MB (01.14%) — objects
│ │ │ ├───7.05 MB (00.70%) — shapes
│ │ │ └───1.45 MB (00.14%) — (5 omitted)
│ │ └──14.85 MB (01.46%) — (8 omitted)
│ ├───34.63 MB (03.42%) — compartment(https://www.facebook.com/plugins/comment…)
│ │ ├──15.11 MB (01.49%) — gc-heap
│ │ │ ├───8.48 MB (00.84%) — objects
│ │ │ ├───5.27 MB (00.52%) — shapes
│ │ │ └───1.37 MB (00.13%) — (4 omitted)
│ │ ├──10.60 MB (01.05%) — scripts
│ │ └───8.92 MB (00.88%) — (7 omitted)
│ ├───31.45 MB (03.10%) — compartment(https://plusone.google.com/u/0/_/+1/fast…)
│ │ ├──14.49 MB (01.43%) — gc-heap
│ │ │ ├───8.70 MB (00.86%) — objects
│ │ │ ├───5.35 MB (00.53%) — shapes
│ │ │ └───0.44 MB (00.04%) — (4 omitted)
│ │ ├───8.73 MB (00.86%) — (7 omitted)
│ │ └───8.23 MB (00.81%) — scripts
│ ├───28.53 MB (02.81%) — compartment(http://pghk.blogspot.com/2011/09/blog-po…)
│ │ ├──15.68 MB (01.55%) — gc-heap
│ │ │ ├───8.80 MB (00.87%) — objects
│ │ │ ├───6.42 MB (00.63%) — shapes
│ │ │ └───0.45 MB (00.04%) — (4 omitted)
│ │ ├───6.83 MB (00.67%) — (6 omitted)
│ │ └───6.03 MB (00.59%) — scripts
│ ├───19.49 MB (01.92%) — compartment(http://www.tomshardware.com/news/arm-pro…)
│ │ ├──10.83 MB (01.07%) — (7 omitted)
│ │ └───8.65 MB (00.85%) — gc-heap
│ │ └──8.65 MB (00.85%) — (6 omitted)
│ ├───18.78 MB (01.85%) — compartment(http://betanews.com/2011/10/25/burnaware…)
│ │ ├──11.99 MB (01.18%) — (8 omitted)
│ │ └───6.79 MB (00.67%) — gc-heap
│ │ └──6.79 MB (00.67%) — (6 omitted)
│ ├───17.64 MB (01.74%) — compartment(http://www.google.com/reviews/polls/disp…)
│ │ ├──10.16 MB (01.00%) — gc-heap
│ │ │ ├───5.55 MB (00.55%) — objects
│ │ │ └───4.62 MB (00.46%) — (5 omitted)
│ │ └───7.47 MB (00.74%) — (8 omitted)
│ ├───16.77 MB (01.65%) — compartment(http://platform.twitter.com/widgets/twee…)
│ │ ├───9.28 MB (00.92%) — gc-heap
│ │ │ └──9.28 MB (00.92%) — (6 omitted)
│ │ └───7.49 MB (00.74%) — (7 omitted)
│ ├───15.72 MB (01.55%) — compartment(http://mediacdn.disqus.com/1317428058/bu…)
│ │ ├───8.66 MB (00.85%) — (8 omitted)
│ │ └───7.05 MB (00.70%) — gc-heap
│ │ └──7.05 MB (00.70%) — (6 omitted)
│ ├───14.85 MB (01.46%) — compartment(http://googleads.g.doubleclick.net/pagea…)
│ │ ├───8.55 MB (00.84%) — gc-heap
│ │ │ └──8.55 MB (00.84%) — (6 omitted)
│ │ └───6.30 MB (00.62%) — (8 omitted)
│ ├───12.69 MB (01.25%) — compartment(http://css.dzone.com/articles/next-relea…)
│ │ └──12.69 MB (01.25%) — (9 omitted)
│ ├───12.46 MB (01.23%) — compartment(https://twitter.com/#!/)
│ │ └──12.46 MB (01.23%) — (9 omitted)
│ ├───11.86 MB (01.17%) — compartment(http://www.hksilicon.com/kb/articles/426…)
│ │ └──11.86 MB (01.17%) — (9 omitted)
│ ├───11.46 MB (01.13%) — compartment(https://static.olark.com/jsclient/storag…)
│ │ ├───9.06 MB (00.89%) — string-chars
│ │ └───2.40 MB (00.24%) — (7 omitted)
│ ├───11.43 MB (01.13%) — compartment(https://plus.google.com/u/0/_/notificati…)
│ │ └──11.43 MB (01.13%) — (9 omitted)
│ ├───10.87 MB (01.07%) — compartment(http://www.launch.is/)
│ │ └──10.87 MB (01.07%) — (9 omitted)
│ ├───10.64 MB (01.05%) — compartment(http://differentapple.blogspot.com/2011/…)
│ │ └──10.64 MB (01.05%) — (8 omitted)
│ ├───10.45 MB (01.03%) — compartment(http://www.rackspace.com/blog/?p=2607&ut…)
│ │ └──10.45 MB (01.03%) — (9 omitted)
│ ├────9.19 MB (00.91%) — compartment(http://www.blogger.com/navbar.g?targetBl…)
│ │ └──9.19 MB (00.91%) — (9 omitted)
│ ├────8.95 MB (00.88%) — compartment(http://www.xbitlabs.com/news/multimedia/…)
│ │ └──8.95 MB (00.88%) — (9 omitted)
│ ├────8.71 MB (00.86%) — compartment(http://www.appleinsider.com/articles/11/…)
│ │ └──8.71 MB (00.86%) — (9 omitted)
│ ├────8.70 MB (00.86%) — compartment(http://vr-zone.com/articles/report-amd-b…)
│ │ └──8.70 MB (00.86%) — (9 omitted)
│ ├────8.59 MB (00.85%) — compartment(http://www.engadget.com/2011/10/25/arm-d…)
│ │ └──8.59 MB (00.85%) — (9 omitted)
│ ├────8.53 MB (00.84%) — compartment(http://thenextweb.com/)
│ │ └──8.53 MB (00.84%) — (9 omitted)
│ ├────7.91 MB (00.78%) — compartment(atoms)
│ │ └──7.91 MB (00.78%) — (2 omitted)
│ ├────7.78 MB (00.77%) — compartment(http://arstechnica.com/business/news/201…)
│ │ └──7.78 MB (00.77%) — (9 omitted)
│ ├────7.72 MB (00.76%) — compartment(http://www.bit-tech.net/news/hardware/20…)
│ │ └──7.72 MB (00.76%) — (9 omitted)
│ ├────7.43 MB (00.73%) — compartment(http://r1rk9np7bpcsfoeekl0khkd2juj27q3o-…)
│ │ └──7.43 MB (00.73%) — (9 omitted)
│ ├────7.10 MB (00.70%) — compartment(http://java.dzone.com/news/lucene-euroco…)
│ │ └──7.10 MB (00.70%) — (9 omitted)
│ ├────6.90 MB (00.68%) — compartment(http://paipaifool.com/index.php?pn=%EF%B…)
│ │ └──6.90 MB (00.68%) — (9 omitted)
│ ├────6.66 MB (00.66%) — compartment(http://www.wired.com/cloudline/2011/10/b…)
│ │ └──6.66 MB (00.66%) — (9 omitted)
│ ├────6.31 MB (00.62%) — compartment(http://unwire.hk/2011/10/25/bluetooth-sm…)
│ │ └──6.31 MB (00.62%) — (9 omitted)
│ └────5.38 MB (00.53%) — compartment(http://www.neowin.net/news/windows-8-ver…)
│ └──5.38 MB (00.53%) — (9 omitted)
├────265.01 MB (26.14%) — heap-unclassified
├─────81.92 MB (08.08%) — layout
│ ├──49.31 MB (04.86%) — arenas
│ └──32.61 MB (03.22%) — styledata
├─────24.38 MB (02.40%) — images
│ ├──24.13 MB (02.38%) — content
│ │ ├──24.12 MB (02.38%) — used
│ │ │ ├──12.62 MB (01.24%) — raw
│ │ │ ├───7.75 MB (00.76%) — uncompressed-nonheap
│ │ │ └───3.75 MB (00.37%) — (1 omitted)
│ │ └───0.01 MB (00.00%) — (1 omitted)
│ └───0.25 MB (00.02%) — (1 omitted)
├─────21.43 MB (02.11%) — storage
│ └──21.43 MB (02.11%) — sqlite
│ ├───8.87 MB (00.87%) — urlclassifier3.sqlite
│ │ ├──8.79 MB (00.87%) — cache-used
│ │ └──0.08 MB (00.01%) — (2 omitted)
│ ├───7.34 MB (00.72%) — places.sqlite
│ │ ├──7.19 MB (00.71%) — cache-used [4]
│ │ └──0.15 MB (00.02%) — (2 omitted)
│ └───5.22 MB (00.52%) — (13 omitted)
├─────19.56 MB (01.93%) — dom
└──────4.63 MB (00.46%) — (4 omitted)

Have you tried NoScript? It disables JS by default, but lets you enable scripts selectively for sites that need it.

A preview function on these blog comments would be useful to posters, and save you time in trying to sort out badly formatted comments.

I just turned on the comment preview plug-in but it doesn’t seem to be doing anything 🙁

That regression stops my update plans in their tracks. Although I haven’t been able to leave Firefox open for days anymore due to its higher memory usage since 3.5, it’s still a goal. Pauses on that order are just not something I can live with. I’ll have to keep an eye on bug 696761 to see when that goes away, because I would very much like to get the benefit of some of the other memory improvements.

That bug has only been reported in the nightly build so far, so unless you’re planning on using one of the prerelease channels (Aurora, Beta, Nightly), you shouldn’t be affected. Given the severity of the problem, I highly doubt that we’d release with it. It might creep into Aurora in a couple of weeks, though.

I’m already on a prerelease–I’m using Firefox 8. My hope was to jump to 10 as soon as it was viable, because while 8 is better than 7 on memory it’s still not great, and that chrome injection bug–if that’s what’s creating my zombie compartments–is an incredible nuisance. And if type inference has a negative impact on 9’s usage, I can’t use that version anyway.

Im curious though as to how the developers plan to stop the regression in its tracks, if there is an effort in place to try to identify where it first occurred or what. I mean I doubt it’ll be released with the regression either, but I’m so sick of this Firebug issue that I’m anxious to get a version with the fix as soon as it’s viable. Realistically speaking I’m wary enough that I’ll probably avoid the aurora and that already means I won’t have my hands on the fix for two more months.

Comments are closed.