{"id":2327,"date":"2012-10-03T15:29:42","date_gmt":"2012-10-03T04:29:42","guid":{"rendered":"http:\/\/blog.mozilla.org\/nnethercote\/?p=2327"},"modified":"2012-10-03T16:19:15","modified_gmt":"2012-10-03T05:19:15","slug":"memshrink-progress-week-67-68","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/nnethercote\/2012\/10\/03\/memshrink-progress-week-67-68\/","title":{"rendered":"MemShrink progress, week 67&#8211;68"},"content":{"rendered":"<p>It&#8217;s been a busy couple of weeks for MemShrink.<\/p>\n<h3>B2G Memory Reporting<\/h3>\n<p>about:memory is our main tool for understanding memory consumption. On desktop Firefox it works very well.\u00a0 On Firefox mobile it works less well, partly because it&#8217;s hard to read all that text on a small screen, <span style=\"text-decoration: line-through;\">and partly because you can&#8217;t cut and paste, which makes bug reporting difficult<\/span>.\u00a0 And on B2G (a.k.a. Firefox OS) it currently doesn&#8217;t work at all.<\/p>\n<p>To remedy this, I implemented <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=768470\">the ability to import and export memory reporter data in JSON format<\/a>, and Justin Lebar <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=788021\">sped up the exporting of this data and implemented a signal-based mechanism for triggering it<\/a>.\u00a0 The idea is that developers can trigger an export of the data from their device and then view it in about:memory in desktop Firefox.<\/p>\n<p>This will allow detailed memory profiling for B2G, which I <a href=\"https:\/\/blog.mozilla.org\/nnethercote\/2012\/07\/11\/memshrink-progress-week-55-56\/\">have listed as #3 on the current MemShrink &#8220;big ticket items&#8221; list<\/a>.\u00a0 The timing is good, because B2G has reached feature-freeze and so focus will now move to its performance and memory consumption as part of &#8220;<a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=797189\">Operation Slim Fast<\/a>&#8220;.<\/p>\n<p>(On a related note, Kartikaya Gupta and other engineers have <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=792131\">started looking closely at the memory consumption of Firefox mobile on low-end devices<\/a>.)<\/p>\n<h3>Generic Memory Reporting<\/h3>\n<p>I <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=747202\">added memory reporting to IonMonkey<\/a>.\u00a0 Happily, it appears to use very little memory, especially compared with JaegerMonkey.\u00a0 This is partly because it generates smaller code than JaegerMonkey, but mostly it&#8217;s because IonMonkey is only used to compile the small fraction of code that has been executed many 1000s of times.\u00a0 In comparison, JaegerMonkey is used to compile the much larger fraction of code that has been executed more than a few times.<\/p>\n<p>Kyle Huey <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=795128\">added memory reporters for attribute nodes and attribute maps<\/a>, which improves the coverage of the memory reporting for the DOM.<\/p>\n<h3>Gecko Slimmings<\/h3>\n<p>Kyle Huey <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=760331\">optimized the representation of repeated inline style rules<\/a>.\u00a0 This means that for pages with many elements of the form <code>&lt;foo style=\"blah\"&gt;<\/code>, the repeated <code>style=\"blah\"<\/code> part is now shared between the elements.\u00a0 This is a huge win on certain large, auto-generated pages.\u00a0 For example, on <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=686795\">one page that holds a gigantic Mercurial diff<\/a>, this change reduced 64-bit Firefox&#8217;s memory consumption from 1,759 MiB to 1,306 MiB.<\/p>\n<p>Kyle Huey and Olli Pettay <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=785248\">fixed a leak relating to web workers<\/a>.<\/p>\n<p>Patrick McManus <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=773255\">fixed a leak in network code that was causing intermittent oranges for Mochitests<\/a>.<\/p>\n<p>Seth Fowler <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=795086\">made nsConsoleService only post a LogMessageRunnable to the event queue if there are any observers for it<\/a>.\u00a0 This can save a lot of memory for pages that contains many errors.<\/p>\n<h3>Bad Graphics Drivers<\/h3>\n<p>An ongoing problem we have is that badly-written graphics drivers can cause outlandish (e.g. multi-GB) memory consumption.\u00a0 Here&#8217;s <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=790062\">one example<\/a> that was fixed by <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=792480\">blocklisting one particular AMD driver<\/a>.\u00a0 (That driver was also causing lots of crashes.)<\/p>\n<p>It&#8217;s got to the point that if someone is seeing excessive memory consumption with no apparent explanation &#8212; e.g. immediately after start-up, with few tabs open &#8212; I&#8217;ll suggest they set layers.acceleration.disabled to true in about:config and there&#8217;s a good chance it&#8217;ll fix the problem.\u00a0 (Restarting in safe mode also disables hardware acceleration.)\u00a0 I don&#8217;t have any good ideas on how to improve this situation.<\/p>\n<h3>Bug Counts<\/h3>\n<p>Here are the current bug counts.<\/p>\n<ul>\n<li>P1: 16 (-8\/+3)<\/li>\n<li>P2: 97 (-2\/+10)<\/li>\n<li>P3: 97 (-6\/+3)<\/li>\n<li>Unprioritized: 3 (-3\/+3)<\/li>\n<\/ul>\n<p>In today&#8217;s MemShrink meeting we closed and downgraded a number of P1 bugs that (a) have been partially addressed, or (b) are less important than they first seemed, or (c) are duplicates.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s been a busy couple of weeks for MemShrink. B2G Memory Reporting about:memory is our main tool for understanding memory consumption. On desktop Firefox it works very well.\u00a0 On Firefox mobile it works less well, partly because it&#8217;s hard to read all that text on a small screen, and partly because you can&#8217;t cut 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":[4261,30,4544,4546],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/2327"}],"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=2327"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/2327\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/media?parent=2327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/categories?post=2327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/tags?post=2327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}