{"id":1404,"date":"2011-11-02T14:53:20","date_gmt":"2011-11-02T03:53:20","guid":{"rendered":"http:\/\/blog.mozilla.org\/nnethercote\/?p=1404"},"modified":"2011-11-04T08:41:15","modified_gmt":"2011-11-03T21:41:15","slug":"memshrink-progress-week-20","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/nnethercote\/2011\/11\/02\/memshrink-progress-week-20\/","title":{"rendered":"MemShrink progress, week 20"},"content":{"rendered":"<h3>Surprise of the week<\/h3>\n<p><strong>[Update: This analysis about livemarks may be wrong.\u00a0 Talos results from early September show that the MaxHeaps number increased, and the reduction when the &#8220;Latest Headlines&#8221; livemark was removed has undone that increase.\u00a0 So livemarks may not be responsible at all, it could just be a coincidence.\u00a0 More investigation is needed!]<\/strong><\/p>\n<p>Jeff Muizelaar <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=696163\">removed the &#8220;Latest Headlines&#8221; live bookmark from new profiles<\/a>.\u00a0 This was in the Bookmarks Toolbar, and so hasn&#8217;t been visible since Firefox 4.0, and most people don&#8217;t use it.\u00a0 And it uses a non-zero amount of memory and CPU.\u00a0 Just how non-zero was unclear until Marco Bonardo noticed some big performance improvements.\u00a0 First, in the Talos &#8220;<a href=\"http:\/\/graphs-new.mozilla.org\/graph.html#tests=[[29,63,8]]&amp;sel=none&amp;displayrange=7&amp;datatype=running\">MaxHeap<\/a>&#8221; results on WinNT5.2:<\/p>\n<p><a href=\"http:\/\/blog.mozilla.org\/nnethercote\/files\/2011\/11\/maxheap.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1407\" title=\"maxheap\" src=\"http:\/\/blog.mozilla.org\/nnethercote\/files\/2011\/11\/maxheap.png\" alt=\"Talos MaxHeap graph\" width=\"625\" height=\"669\" srcset=\"https:\/\/blog.mozilla.org\/nnethercote\/files\/2011\/11\/maxheap.png 625w, https:\/\/blog.mozilla.org\/nnethercote\/files\/2011\/11\/maxheap-280x300.png 280w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p>And secondly in the Talos &#8220;<a href=\"http:\/\/graphs-new.mozilla.org\/graph.html#tests=[[30,63,8],[30,63,7]]&amp;sel=none&amp;displayrange=7&amp;datatype=running\">Allocs<\/a>&#8221; results on WinNT5.2 and Mac10.5.2:<\/p>\n<p><a href=\"http:\/\/blog.mozilla.org\/nnethercote\/files\/2011\/11\/allocs.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1408\" title=\"allocs\" src=\"http:\/\/blog.mozilla.org\/nnethercote\/files\/2011\/11\/allocs.png\" alt=\"Talos Allocs graph\" width=\"619\" height=\"674\" srcset=\"https:\/\/blog.mozilla.org\/nnethercote\/files\/2011\/11\/allocs.png 619w, https:\/\/blog.mozilla.org\/nnethercote\/files\/2011\/11\/allocs-275x300.png 275w\" sizes=\"(max-width: 619px) 100vw, 619px\" \/><\/a><\/p>\n<p>In the WinNT5.2 cases, it looks like we had a bi-modal distribution previously, and this patch changed things so that the higher of the two cases never occurred.\u00a0 In the Mac10.5.2 case we just had a simple reduction in the number of allocations.\u00a0 On Linux the results were less conclusive, but there may have been a similar if smaller effect.<\/p>\n<p>This surprised me greatly.\u00a0 I&#8217;ve done a lot of memory profiling of Firefox and never seen anything that pointed to the feed reader as using a lot of memory.\u00a0 This may be because the feed reader&#8217;s usage is falling into a larger, innocuous bucket, such as JS or generic strings.\u00a0 Or maybe I just missed the signs altogether.<\/p>\n<p>Some conclusions and questions:<\/p>\n<ul>\n<li>If you have live bookmarks in your bookmarks toolbar, remove them! <strong>[Update: I meant to say &#8220;unused live bookmarks&#8221;.]<\/strong><\/li>\n<li>We need to work out what is going on with the feed reader, and optimize its memory usage.<\/li>\n<li>Can we disable unused live bookmarks for existing users?<\/li>\n<\/ul>\n<p>Apparently nobody really owns the feed reader, because previous contributors to it have all moved on.\u00a0 So I&#8217;m planning to investigate, but I don&#8217;t know the first thing about it.\u00a0 Any help would be welcome!<\/p>\n<h3>\u00a0Other stuff<\/h3>\n<p>There was a <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=678811\">huge memory leak in the Video DownloadHelper add-on<\/a> v4.9.5, and possibly earlier versions.\u00a0 This has been <a href=\"http:\/\/bugzilla.downloadhelper.net\/show_bug.cgi?id=309\">fixed<\/a> in <a href=\"http:\/\/www.downloadhelper.net\/install-beta.php?version=4.9.6a3\">v4.9.6a3<\/a> and the fix will make it into the final version v4.9.6 when it is released.\u00a0 That&#8217;s one more add-on leak down, I wonder how many more there are to go.<\/p>\n<p>TraceMonkey, the trace JIT, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=697666\">is no longer built by default<\/a>.\u00a0 This means it&#8217;s no longer used, and this saves both code and data space.\u00a0 The old combination of TraceMonkey and JaegerMonkey is slower than the new combination of JaegerMonkey with type inference, and TraceMonkey is also preventing various clean-ups and simplifications, so it&#8217;ll be <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=698201\">removed entirely<\/a> soon.<\/p>\n<p>I <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=697016\">refined the JS memory reporters<\/a> in about:memory to give more information about objects, shapes and property tables.<\/p>\n<p>I <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=697646\">avoided creating small property tables<\/a>, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=697931\">removed KidHashes when possible<\/a>, and <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=697933\">reduced the size of KidHashes with few entries<\/a>.<\/p>\n<p>I wrote about <a href=\"http:\/\/blog.mozilla.org\/nnethercote\/?p=1369&amp;preview=true\">various upcoming memory optimizations in the JS engine<\/a>.<\/p>\n<p>Justin Lebar enabled jemalloc on MacOS 10.5 builds.\u00a0 This was expected to be a space improvement, but it also reduced the &#8220;Tp5 MozAfterPaint&#8221; page loading benchmark by 8%.<\/p>\n<p>Robert O&#8217;Callahan <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=678859\">avoided excessive memory usage in certain DOM animations on Windows<\/a>.<\/p>\n<p>Drew Willcoxon <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=687777\">avoided excessive memory usage in context menu items created by the add-on SDK<\/a>.<\/p>\n<h3>Bug Counts<\/h3>\n<ul>\n<li>P1: 35 (-1, +1)<\/li>\n<li>P2: 116 (-2, +5)<\/li>\n<li>P3: 55 (-2, +3)<\/li>\n<li>Unprioritized: 5 (-4, +5)<\/li>\n<\/ul>\n<p>At this week&#8217;s MemShrink meeting we only had 9 bugs to triage, which is the lowest we&#8217;ve had in a long time.\u00a0 It feels like the MemShrink bug list is growing slower than in the past.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Surprise of the week [Update: This analysis about livemarks may be wrong.\u00a0 Talos results from early September show that the MaxHeaps number increased, and the reduction when the &#8220;Latest Headlines&#8221; livemark was removed has undone that increase.\u00a0 So livemarks may not be responsible at all, it could just be a coincidence.\u00a0 More investigation is needed!] [&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,4543,4544,4546,467,1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/1404"}],"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=1404"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/1404\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/media?parent=1404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/categories?post=1404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/tags?post=1404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}