{"id":2554,"date":"2013-04-03T15:49:57","date_gmt":"2013-04-03T04:49:57","guid":{"rendered":"http:\/\/blog.mozilla.org\/nnethercote\/?p=2554"},"modified":"2013-04-10T07:19:54","modified_gmt":"2013-04-09T20:19:54","slug":"memshrink-progress-week-93-94","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/nnethercote\/2013\/04\/03\/memshrink-progress-week-93-94\/","title":{"rendered":"MemShrink progress, week 93&#8211;94"},"content":{"rendered":"<p>After lots of activity in the previous month, the past two weeks have been fairly quiet for MemShrink.<\/p>\n<h3>AWSY<\/h3>\n<p>areweslimyet.com has been proving its worth.<\/p>\n<p>Jonathan Kew <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=844669\">reduced the amount of memory taken by fonts on Fennec at start-up<\/a>, which was detected by AWSY\/mobile.\u00a0 Jonathan also <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=846832\">reverted a change that AWSY detected as increasing Fennec memory consumption<\/a>, and filed a <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=847344\">follow-up<\/a> to investigate further.<\/p>\n<p>Joe Drew <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=853390\">fixed a bad regression on AWSY relating to image decoding<\/a>.\u00a0 It&#8217;s not clear to me if this was a genuine regression that users would have seen, or if it was an artifact of the way AWSY does its measurements.\u00a0 Either way, it&#8217;s good that it was fixed, and props to Joe for doing it so quickly.<\/p>\n<p>Finally, we closed <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=833518\">bug 833518<\/a>, which was for an AWSY regression caused by the new DOM bindings.\u00a0 This was previously improved by an Aurora-only hack, but enough cases have been translated to the new bindings that we&#8217;re naturally down almost to where we were.<\/p>\n<h3>Miscellaneous<\/h3>\n<p>The mobile team abandoned their <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=792131\">goal of making Fennec work on phones with only 256 MiB of memory<\/a>.\u00a0 The rationale is that Android phones with only 256 MiB of RAM are uncommon, whereas low-end phones that meet the current minimum of 384 MiB are much more common.\u00a0 The mobile team will of course continue to look for ways to improve memory consumption in order to make life for users with 384 MiB phones.<\/p>\n<p>I <a href=\"https:\/\/bugzilla.mozilla.org\/\/show_bug.cgi?id=851421\">modified the JS engine so that it doesn&#8217;t emit bytecode for asm.js functions in the normal case<\/a>.\u00a0 This reduced the memory consumption of the Unreal 3 demo used at GDC by about 100 MiB. \u00a0I also <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=854763\">added a memory reporter for array buffers used by asm.js<\/a>, which are often quite large and weren&#8217;t being measured on 64-bit platforms.<\/p>\n<p>Alexandre Poirot <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=839280\">fixed a leak relating to dev tools<\/a>.<\/p>\n<p>Randell Jesup <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=848946\">fixed a small leak in WebRTC<\/a>.<\/p>\n<h3>Help Needed<\/h3>\n<p>I&#8217;m working on <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=848560\">adding a button to about:memory trigger the dumping of memory reporter data to file<\/a>.\u00a0 I have a patch awaiting review, but I&#8217;m getting a test failure on Windows.\u00a0 The test saves gzipped memory reports to file, and then immediately loads that saved file (and uncompresses it) and checks the data looks as expected.\u00a0 This works fine on Mac and Linux, but on Windows I&#8217;m sometimes getting incomplete data in the load step.\u00a0 The file is quite short (just 253 bytes compressed, and 620 bytes uncompressed) and the truncation point varies between runs;\u00a0 in the most severe occurrence only 9 bytes of uncompressed data were loaded, though the cut-off point seems to vary randomly.<\/p>\n<p>I suspect there&#8217;s a file synchronization problem between the save and the load, even though gzclose() is called on the save file before the loading occurs.\u00a0 If anyone has ideas about what the problem might be, I&#8217;d love to hear them.<\/p>\n<p><strong>Update: Nils Maier and an anonymous commenter pointed out the problem &#8212; I was using &#8220;r&#8221; instead of &#8220;rb&#8221; for the file mode.\u00a0 On Windows, this causes <a href=\"http:\/\/stackoverflow.com\/questions\/11141422\/why-use-fopen-mode-b-stdio-h-when-output-can-be-non-ascii-regardless\">mangling of EOL chars<\/a>.<\/strong><\/p>\n<p>Also, we&#8217;re seeing some <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=855151\">strange behaviour on Mac OS X where memory managed by jemalloc doesn&#8217;t appear to be released back to the OS as it should<\/a>.\u00a0 This is both alarming and hard to understand, which is not a good combination.<\/p>\n<h3>Good First Bugs<\/h3>\n<p>I have two easy bugs assigned to me that I probably won&#8217;t get around to for some time.\u00a0 Both of them would be good first (or second, or third&#8230;) bugs.<\/p>\n<ul>\n<li><a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=857382\">Bug 857382<\/a> is about making about:memory handle memory report diffs more elegantly.<\/li>\n<li><a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=798914\">Bug 798914<\/a> is just a minor code clean-up.\u00a0 Nothing too exciting, but first bugs often aren&#8217;t!<\/li>\n<\/ul>\n<p>Please email or comment in one of the bugs if you are interested in helping.<\/p>\n<h3>Bug Counts<\/h3>\n<p>Here are the current bug counts.<\/p>\n<ul>\n<li>P1: 15 (-0\/+2)<\/li>\n<li>P2: 138 (-4\/+8)<\/li>\n<li>P3: 129 (-2\/+7)<\/li>\n<li>Unprioritized: 1 (-3\/+0)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>After lots of activity in the previous month, the past two weeks have been fairly quiet for MemShrink. AWSY areweslimyet.com has been proving its worth. Jonathan Kew reduced the amount of memory taken by fonts on Fennec at start-up, which was detected by AWSY\/mobile.\u00a0 Jonathan also reverted a change that AWSY detected as increasing Fennec [&hellip;]<\/p>\n","protected":false},"author":139,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4550,451,30,4544,4546],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/2554"}],"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=2554"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/2554\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/media?parent=2554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/categories?post=2554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/tags?post=2554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}