{"id":1902,"date":"2012-05-02T17:24:09","date_gmt":"2012-05-02T06:24:09","guid":{"rendered":"http:\/\/blog.mozilla.org\/nnethercote\/?p=1902"},"modified":"2012-05-02T17:24:09","modified_gmt":"2012-05-02T06:24:09","slug":"memshrink-progress-week-45-46","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/nnethercote\/2012\/05\/02\/memshrink-progress-week-45-46\/","title":{"rendered":"MemShrink progress, week 45&#8211;46"},"content":{"rendered":"<h3>FIXING LEAKS<\/h3>\n<p>The big news this week is that Kyle Huey <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=695480\">made chrome-to-content leaks impossible<\/a>.\u00a0 Kyle <a href=\"http:\/\/blog.kylehuey.com\/post\/21892343371\/fixing-the-memory-leak\">wrote about this in some detail<\/a>.\u00a0 This particular kind of leak can happen in Firefox, but more importantly, it&#8217;s responsible for most of the leaks in add-ons that we <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=700547\">know about<\/a>.\u00a0 In other words, it should greatly reduce the problem of leaky add-ons, a problem I previously identified as the <a href=\"http:\/\/blog.mozilla.org\/nnethercote\/2012\/01\/25\/memshrink-progress-week-32\/\">#1 MemShrink issue<\/a>.\u00a0 It&#8217;ll take a while to see the exact effects and whether they match expectations.\u00a0 Nonetheless, this is <a href=\"http:\/\/mozillamemes.tumblr.com\/post\/21838140313\/if-our-existing-strategy-has-been-plugging-the\">a big deal<\/a>!<\/p>\n<p>Olli Pettay <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=731875\">fixed a leak relating to Geolocation<\/a>.<\/p>\n<p>The following add-ons had leaks fixed: <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=730784\">Collusion<\/a>, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=729378\">SearchMenu<\/a>, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=730683\">panchang<\/a>, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=724468\">HTML5 Extension for Windows Media Player Firefox Plug-in<\/a>.<\/p>\n<h3>Slimmer data structures<\/h3>\n<p>I reduced the size of JSScripts (<a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=738153\">here<\/a>, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=739512\">here<\/a> and <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=742163\">here<\/a>).\u00a0 This increased the number of JSScripts that fit in a GC arena from 31 to 42 (on 32-bit platforms) and from 19 to 28 (on 64-bit platforms).\u00a0 This reduced the size of the &#8220;scripts&#8221; entry in about:memory &#8212; which is often multiple MB for the compartments of complex web sites and apps like Gmail &#8212; by approximately 30%.\u00a0 (The final two patches in the sequence are being held up by the current <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=750661\">tree closure<\/a>, but will land as soon as that has passed.)<\/p>\n<p>Nathan Froyd reduced the size of mozilla::dom::Link &#8212; one of which exists for every &lt;a&gt; or &lt;link&gt; or &lt;area&gt; element shown in a page &#8212; by 4 bytes (on 32-bit platforms) and 8 bytes (on 64-bit platforms).<\/p>\n<p>Ehsan Akhgari reduced the size of nsEditor &#8212; one of which exists for each text area in a page, and some other places &#8212; by 16 bytes on 64-bit platforms.<\/p>\n<h3>\u00a0Quote of the FORTNIGHT<\/h3>\n<p>PC Advisor <a href=\"http:\/\/www.pcadvisor.co.uk\/news\/internet\/3351840\/whats-fastest-browser-maybe-youre-measuring-wrong\/\">featured an article about browser performance<\/a>.\u00a0 The article criticized the standard browser benchmarks for (a) not representing everyday browsing and (b) underestimating the effects of memory consumption on browser performance &#8212; two things that I agree with.<\/p>\n<p>The article also presented some cross-browser memory consumption results from real-world-ish workloads.\u00a0 The testing was imperfect &#8212; for example, it didn&#8217;t measure memory consumption after any kind of prolonged usage &#8212; but I liked the fact that the author had actually thought about things instead of just mindlessly running the standard benchmarks.<\/p>\n<p>And with my PR hat on, I was happy with the conclusion.<\/p>\n<blockquote><p>Firefox is the clear winner of the bunch. It was the only browser that did not slow things down and I recommended it for both lower-end mobile devices and high-end desktops.<\/p><\/blockquote>\n<p>In general, cross-browser memory consumption comparisons are difficult to do well.\u00a0 My preferred method is to run some set of benchmarks on a machine with a small amount of RAM, as that gives a genuine indication of the performance effect.\u00a0 &#8220;Browser A was 50% slower on benchmark X when I halved the available RAM, but browser B was only 10% slower&#8221; is much more meaningful than &#8220;Browser A used 20% more memory on benchmark X than browser B&#8221;.\u00a0 Choosing good benchmarks is still not easy, though.<\/p>\n<h3>Bug counts<\/h3>\n<p>Here are the current bug counts.<\/p>\n<ul>\n<li>P1: 21 (-1\/+0)<\/li>\n<li>P2: 85 (-14\/+15)<\/li>\n<li>P3: 104 (-5\/+9)<\/li>\n<li>Unprioritized: 1 (-0\/+1)<\/li>\n<\/ul>\n<p>I&#8217;m thinking about omitting the bug counts from future MemShrink reports.\u00a0 I don&#8217;t feel like they add much, but I&#8217;d be interested to hear if people think otherwise.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FIXING LEAKS The big news this week is that Kyle Huey made chrome-to-content leaks impossible.\u00a0 Kyle wrote about this in some detail.\u00a0 This particular kind of leak can happen in Firefox, but more importantly, it&#8217;s responsible for most of the leaks in add-ons that we know about.\u00a0 In other words, it should greatly reduce the [&hellip;]<\/p>\n","protected":false},"author":139,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[119,30,4544,4546],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/1902"}],"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=1902"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/1902\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/media?parent=1902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/categories?post=1902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/tags?post=1902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}