{"id":1020,"date":"2011-07-13T15:12:10","date_gmt":"2011-07-13T04:12:10","guid":{"rendered":"http:\/\/blog.mozilla.org\/nnethercote\/?p=1020"},"modified":"2011-07-13T15:12:10","modified_gmt":"2011-07-13T04:12:10","slug":"memshrink-progress-week-4","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/nnethercote\/2011\/07\/13\/memshrink-progress-week-4\/","title":{"rendered":"MemShrink progress, week 4"},"content":{"rendered":"<p>Firefox 7 is currently in the <a href=\"http:\/\/aurora.mozilla.org\">Aurora channel<\/a>.\u00a0 Its memory usage improvements have been getting a lot of attention this week, with many people reporting the 30% improvement claims from the <a href=\"http:\/\/blog.mozilla.org\/futurereleases\/2011\/07\/07\/firefoxaurora7\/\">official blog post<\/a>.\u00a0 I was worried about the post claiming a specific percentage improvement, because there are various ways to measure memory usage, and it varies so greatly depending on the workload, but I haven&#8217;t seen anybody dispute it so far.\u00a0 In fact, the only non-Mozilla measurement I saw was one where a reviewer\u00a0 <a href=\"http:\/\/www.legitreviews.com\/news\/11038\/\">opened 117 bookmarks at once<\/a> (one bookmark per tab) and saw a 40% reduction in private bytes on Windows!\u00a0 This was a pleasant surprise as we were expecting improvements mostly when users (a) closed lots of tabs, or (b) left the browser idle for a long time.<\/p>\n<p>The most significant MemShrink-related landings this week were things that were subsequently backed out.\u00a0 Paul Biggar landed <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=414946\">jemalloc support for Mac<\/a>, then had to revert it due to some crashes and possible memory usage regressions.\u00a0 This support has ended up being an enormous hassle, and Paul&#8217;s been tirelessly battling various Mac OS X quirks and annoyances over a period of several months.\u00a0 An earlier appraisal that &#8220;<a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=414946#c21\">It should be pretty trivial&#8230;\u00a0I don&#8217;t think any of this would be a ton of work. Maybe a week of trying a few different things and running it through our unit tests?<\/a>&#8221; turned out to be spectacularly wrong.\u00a0 Hopefully Paul will be able to fix the problems and re-land soon.<\/p>\n<p>Brian Hackett merged his <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=608741\">JavaScript type inference<\/a> from the <a href=\"http:\/\/hg.mozilla.org\/projects\/jaegermonkey\">jaegermonkey<\/a> repository to the <a href=\"http:\/\/hg.mozilla.org\/tracemonkey\/\">tracemonkey<\/a> repository.\u00a0 Type inference speeds up computationally-intensive JavaScript code <a href=\"http:\/\/www.arewefastyet.com\/?a=b&amp;view=regress\">significantly<\/a>, but unfortunately it increased memory usage a lot, due to (a) the memory required for the analysis itself, and (b) some extra memory used by the executing JavaScript code.\u00a0 As a result, Brian had to back it out from the tracemonkey repository.\u00a0 He&#8217;s now making good progress on <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=669815\">reducing the overhead<\/a>.\u00a0 One reason that this happened is that the jaegermonkey repository gets very little use, so the problem wasn&#8217;t noticed until it landed on the tracemonkey repository which gets more use.\u00a0 So if you want to help Brian out, please try browser builds from the jaegermonkey repository.<\/p>\n<p>On the tools front:<\/p>\n<ul>\n<li>Per-compartment memory reporters have found several cases of &#8220;zombie compartments&#8221;, which is when a tab is closed but one or more of its compartments stay around.\u00a0 <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=668871\">Bug 668871<\/a> is tracking these leaks;\u00a0 if you see any like this please report them there.<\/li>\n<li>Benoit Jacob landed some <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=638549\">memory reporters for WebGL<\/a>, which will show up in about:memory, and I fixed a <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=669005\">problem<\/a> that was causing JavaScript typed arrays to erroneously fall into the &#8220;heap-unclassified&#8221; bucket in about:memory.<\/li>\n<li>Speaking of which, that &#8220;heap-unclassified&#8221; number is still higher than we&#8217;d like, often in the 35&#8211;45% range.\u00a0 If you see a particular site that causes &#8220;heap-unclassified&#8221; to go unusually high, please report it <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=563700\">here<\/a>.<\/li>\n<\/ul>\n<p>Finally, here&#8217;s the MemShrink bug count, with the changes since last week:<\/p>\n<ul>\n<li>P1: 24 (+6)<\/li>\n<li>P2: 49 (+5)<\/li>\n<li>P3: 29 (+4)<\/li>\n<li>Unprioritized: 2 (+0)<\/li>\n<\/ul>\n<p>The increases look bad, but I think that&#8217;s not because progress isn&#8217;t being made.\u00a0 Rather, it&#8217;s a reflection that MemShrink efforts are still ramping up, and people are coming up with lots of new ideas and filing bugs for them.\u00a0 The upwards trend will probably continue for several more weeks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Firefox 7 is currently in the Aurora channel.\u00a0 Its memory usage improvements have been getting a lot of attention this week, with many people reporting the 30% improvement claims from the official blog post.\u00a0 I was worried about the post claiming a specific percentage improvement, because there are various ways to measure memory usage, and [&hellip;]<\/p>\n","protected":false},"author":139,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30,4544,4546],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/1020"}],"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=1020"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/1020\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/media?parent=1020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/categories?post=1020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/tags?post=1020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}