{"id":2432,"date":"2013-02-06T15:54:27","date_gmt":"2013-02-06T04:54:27","guid":{"rendered":"http:\/\/blog.mozilla.org\/nnethercote\/?p=2432"},"modified":"2013-02-06T15:54:27","modified_gmt":"2013-02-06T04:54:27","slug":"memshrink-progress-week-85-86","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/nnethercote\/2013\/02\/06\/memshrink-progress-week-85-86\/","title":{"rendered":"MemShrink progress, week 85&#8211;86"},"content":{"rendered":"<p>Lots of news today.<\/p>\n<h3>Fixed Regressions<\/h3>\n<p>I wrote <a href=\"https:\/\/blog.mozilla.org\/nnethercote\/2013\/01\/23\/memshrink-progress-week-83-84\/\">last time<\/a> about a couple of bad regressions that AWSY identified.<\/p>\n<ul>\n<li>Seth Fowler <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=820602\">fixed the bigger of the two<\/a>, which related to the handling of images.\u00a0 This won us back about 40 MB.<\/li>\n<li>Peter Van der Beken <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=833518\">ameliorated the smaller of the two on Aurora, which related to DOM bindings<\/a>.\u00a0 This won back about 12 MB.<\/li>\n<\/ul>\n<p>The ongoing DOM bindings work will hopefully fully fix the second regression before the end of this development cycle (February 18).<\/p>\n<h3>AWSY<\/h3>\n<p>John Schoenick made three big improvements to <a href=\"https:\/\/areweslimyet.com\">AWSY<\/a>.<\/p>\n<ul>\n<li>It now measures every push to mozilla-inbound.\u00a0 Previously it measured mozilla-central once per day.\u00a0 This will make it easier and faster to identify patches responsible for regressions.<\/li>\n<li>It&#8217;s now possible to trigger an AWSY run for any try build.\u00a0 Unfortunately John hasn&#8217;t yet written instructions on how to do this;\u00a0 I hope he will soon&#8230;<\/li>\n<li>AWSY now <a href=\"https:\/\/www.areweslimyet.com\/mobile\/\">measures Fennec<\/a> as well.\u00a0 Kartikaya Gupta <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=792165\">created the benchmark that is used for this<\/a>.\u00a0 He also <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=837131\">fixed a 4 MB regression that it identified<\/a>.<\/li>\n<\/ul>\n<h3>Leaks Fixed<\/h3>\n<p>Benoit Jacob <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=834470\">fixed a CC leak<\/a> that he found with his <a href=\"https:\/\/github.com\/bjacob\/mozilla-central\/wiki\/Refgraph\">refgraph<\/a> tool.<\/p>\n<p>Johnny Stenback <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=836173\">fixed a leak involving SVG<\/a> that he found with DMD.\u00a0 This was a very slow leak that Johnny had seen repeatedly, which manifested as slowly increasing &#8220;heap-unclassified&#8221; values in about:memory over days or even weeks.\u00a0 It&#8217;s a really nice case because it shows that DMD can be used on long-running sessions with minimal performance impact.<\/p>\n<p>Justin Lebar <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=833796\">fixed a B2G leak relating to forms.js<\/a>.<\/p>\n<p>Randall Jesup <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=836294\">fixed a leak relating to WebRTC<\/a>.<\/p>\n<p>Andrew McCreight <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=837033\">fixed a leak relating to HTMLButtonElement<\/a>.<\/p>\n<p>Erik Vold <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=835011\">fixed a leak in the Restartless Restart add-on<\/a>.<\/p>\n<h3>Miscellaneous<\/h3>\n<p>Brian Hackett <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=827490\">optimized the representation of JS objects that feature both array (indexed) elements and named properties<\/a>.\u00a0 Previously, if an object had both elements and named properties, it would use a sparse representation that was very memory-inefficient if many array elements were present.\u00a0 This performance fault had been known <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=586842\">for a long time<\/a>, and it caused bad memory blow-ups every once in a while, so it&#8217;s great to have it fixed.<\/p>\n<p>As a follow-up, Brian <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=835102\">also made it possible for objects that use the sparse representation to change back to the dense array representation if enough array elements are subsequently added<\/a>.\u00a0 This should also avoid some occasional blow-ups that occur when arrays get filled in in complex ways.<\/p>\n<p>Gregory Szorc reduced the memory consumption of the new Firefox Health Report feature, from ~3 MB to ~1&#8211;1.5 MB: <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=833609\">here<\/a> and <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=834449\">here<\/a> and <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=834936\">here<\/a> and <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=836177\">here<\/a>. On a related note, Bill McCloskey is making good progress with <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=759585\">reducing compartment overhead<\/a>, which should be a sizeable win once it lands.<\/p>\n<p>Gregory also reduced the memory consumption of Firefox Sync:\u00a0\u00a0https: <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=836120\">here<\/a> and <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=836086\">here<\/a>.<\/p>\n<p>Jonathan Kew <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=837729\">reduced the amount of memory used by textruns when Facebook Messenger is enabled<\/a>.<\/p>\n<p>The <a href=\"http:\/\/www.oxymoronical.com\/blog\/2013\/02\/The-Add-on-SDK-is-now-in-Firefox\">Add-on SDK is now present in mozilla-central<\/a>, which is a big step towards getting all add-ons that use it to always use the latest version.\u00a0 This is nice because it will mean that when memory leaks in the SDK are fixed (and there have been many) all add-ons that use it will automatically get the benefit, without having to be repacked.<\/p>\n<h3>Generational GC<\/h3>\n<p>Generational garbage collection is an ongoing JS engine project that should reap big wins once it&#8217;s completed.\u00a0 I don&#8217;t normally write about things that haven&#8217;t been finished, but this is a big project and I&#8217;ve had various people asking about it recently, so here&#8217;s an update.<\/p>\n<p>Generational GC is one the JS teams two major goals for the near-term.\u00a0 (The other is benchmark and\/or game performance, I can&#8217;t remember which.)\u00a0 You can see from the <a href=\"https:\/\/wiki.mozilla.org\/Javascript:SpiderMonkey:ProjectGenerationGarbageCollection\">plan<\/a> that there are eight people working on it (though not all of them are working on it all the time).<\/p>\n<p>Brian Hackett <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=829243\">implemented a static analysis that can determine which functions in the JS engine can trigger garbage collection<\/a>.\u00a0 On top of that, he then <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=831409\">implemented a static analysis that can identify rooting hazards and unnecessary roots<\/a>.\u00a0 This may sound esoteric, but it has massively reduced the amount of work required to complete <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=753203\">exact rooting<\/a>, which is the key prerequisite for generational GC.\u00a0 To give you an idea:\u00a0 Terrence Cole estimated that it reduced the number of distinct code locations that need to be looked at and possibly modified from ~10,000 to ~200!\u00a0 Great stuff.<\/p>\n<p>Another good step was taken when I <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=788293\">removed support for E4X from the JS engine<\/a>.\u00a0 E4X is an old JavaScript language extension that never gained wide support and was only implemented in Firefox.\u00a0 The code implementing it was complicated, and an ongoing source of many bugs and security flaws.\u00a0 The removal cut almost 13,000 lines of code and over 16,000 lines of tests.\u00a0 It&#8217;s been destined for the chopping block for a long time, and its presence has been blocking generational GC, so all the JS team members are glad to see it go.<\/p>\n<h3>Bug Counts<\/h3>\n<p>Here are the current bug counts.<\/p>\n<ul>\n<li>P1: 16 (-5\/+0)<\/li>\n<li>P2: 119 (-6\/+0)<\/li>\n<li>P3: 104 (-0\/+0)<\/li>\n<li>Unprioritized: 22 (-0\/+18)<\/li>\n<\/ul>\n<p>Three of the P1 &#8220;fixes&#8221; weren&#8217;t actual fixes, but cases where a bug was WONTFIXed, or downgraded.\u00a0 The unprioritized number is high because we skipped this week&#8217;s MemShrink meeting due to the DOM work week in London, which occupied three of our regular contributors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lots of news today. Fixed Regressions I wrote last time about a couple of bad regressions that AWSY identified. Seth Fowler fixed the bigger of the two, which related to the handling of images.\u00a0 This won us back about 40 MB. Peter Van der Beken ameliorated the smaller of the two on Aurora, which related [&hellip;]<\/p>\n","protected":false},"author":139,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4557,30,4555,4544,4546],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/2432"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/users\/139"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/comments?post=2432"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/2432\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/media?parent=2432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/categories?post=2432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/tags?post=2432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}