{"id":2384,"date":"2012-12-12T15:46:50","date_gmt":"2012-12-12T04:46:50","guid":{"rendered":"http:\/\/blog.mozilla.org\/nnethercote\/?p=2384"},"modified":"2012-12-12T15:46:50","modified_gmt":"2012-12-12T04:46:50","slug":"memshrink-progress-week-77-78","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/nnethercote\/2012\/12\/12\/memshrink-progress-week-77-78\/","title":{"rendered":"MemShrink progress, week 77&#8211;78"},"content":{"rendered":"<h3>DMD<\/h3>\n<p>The big news this week is the landing of the <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=717853\">native version of DMD<\/a>.\u00a0 The <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=676724\">old version of DMD<\/a> is a Valgrind-based tool that has been instrumental in reducing the size of about:memory&#8217;s &#8220;heap-unclassified&#8221;.\u00a0 (For example, with trunk builds on my Linux desktop machine it&#8217;s now frequently less than 10%.)<\/p>\n<p>However, the old version of DMD wasn&#8217;t easy to run.\u00a0 For example, it required patching Valgrind&#8217;s source code and re-building it, among other things.\u00a0 As a result, only a handful of people ever ran it.\u00a0 Furthermore, because it&#8217;s a Valgrind tool it is very slow and will never run on Windows.<\/p>\n<p>In contrast, the new version is much easier to use.\u00a0 It just requires a slight configuration change at build time and a slight change in how the browser is invoked.<\/p>\n<p>It&#8217;s also much faster, especially if you use the sampling mode which trades a small amount of precision for a great deal of speed.\u00a0 Crucially, this means it is usable on B2G.\u00a0 Also, it should be possible for people to use it for long-running sessions, which can be helpful for identifying slow leaks.<\/p>\n<p>And while the new version doesn&#8217;t currently run on Windows, it should be fairly straightforward to get it working.\u00a0 If anyone is interested in helping with this, please contact me, or take a look at\u00a0<a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=819839\">the open bug<\/a>.<\/p>\n<p>I will write a more detailed post about the new version some time in the next few days, once I have updated the documentation and finalized a few more tweaks that should improve usability.\u00a0 In the meantime, Justin Lebar is already using it in earnest to better understand B2G&#8217;s memory consumpion (e.g. see <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=820128\">here<\/a>, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=820132\">here<\/a>, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=820133\">here<\/a>, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=820134\">here<\/a>, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=820242\">here<\/a>, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=820244\">here<\/a>, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=820248\">here<\/a>).<\/p>\n<p>Thanks to Mike Hommey for his <a href=\"http:\/\/glandium.org\/blog\/?p=2848\">excellent replace-malloc infrastructure<\/a>, on which the new version is built, and to Justin for lots of help, especially with Android and B2G details.<\/p>\n<h3>B2G<\/h3>\n<p>The option that allows B2G to merge system compartments, previously implemented and landed by Kyle Huey, was <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=810719\">enabled by default<\/a>.\u00a0 This is a big deal, because it&#8217;s the single biggest memory consumption improvement B2G has seen and is likely to see before version 1 is released.<\/p>\n<p>Gabriel Svelto <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=811740\">reduced the number of unused dirty pages kept around by jemalloc on B2G<\/a>.\u00a0 This can save ~4 MiB of memory across all processes, at a potential cost of making some allocations a little slower.\u00a0 On a device as memory-constrained as the B2G phones, this is a good trade-off.<\/p>\n<h3>Social API<\/h3>\n<p>Felipe Gomes <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=811247\">reduced the memory consumption of the social API when multiple browser windows are open<\/a>.\u00a0 This change has been backported to the beta channel, so it will be present in Firefox 18, in time for the bigger publicity push for this feature.\u00a0 (For those of you that don&#8217;t like Facebook, please note that if you don&#8217;t enable the social API it will not affect Firefox&#8217;s performance in any way.)<\/p>\n<h3>Miscellaneous<\/h3>\n<p>I <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=815829\">added a MEMORY_VSIZE telemetry reporters, which measures virtual memory consumption<\/a>.\u00a0 This might help us understand how many Windows users would benefit from 64-bit builds.<\/p>\n<h3>Bug counts<\/h3>\n<p>Here are the current bug counts.<\/p>\n<ul>\n<li>P1: 17 (-3\/+3)<\/li>\n<li>P2: 126 (-2\/+14)<\/li>\n<li>P3: 106 (-4\/+7)<\/li>\n<li>Unprioritized: 0 (-2\/+0)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>DMD The big news this week is the landing of the native version of DMD.\u00a0 The old version of DMD is a Valgrind-based tool that has been instrumental in reducing the size of about:memory&#8217;s &#8220;heap-unclassified&#8221;.\u00a0 (For example, with trunk builds on my Linux desktop machine it&#8217;s now frequently less than 10%.) However, the old version [&hellip;]<\/p>\n","protected":false},"author":139,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4261,4557,30,4544,4546],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/2384"}],"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=2384"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/2384\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/media?parent=2384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/categories?post=2384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/tags?post=2384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}