{"id":1524,"date":"2011-12-14T15:12:52","date_gmt":"2011-12-14T04:12:52","guid":{"rendered":"http:\/\/blog.mozilla.org\/nnethercote\/?p=1524"},"modified":"2011-12-14T15:12:52","modified_gmt":"2011-12-14T04:12:52","slug":"memshrink-progress-week-26","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/nnethercote\/2011\/12\/14\/memshrink-progress-week-26\/","title":{"rendered":"MemShrink progress, week 26"},"content":{"rendered":"<p>It&#8217;s been six months since MemShrink started!\u00a0 Here are this week&#8217;s events of note.<\/p>\n<h3>Memory Reporting<\/h3>\n<p>I <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=704400\">integrated DMD support into Firefox<\/a>.\u00a0 This is a big deal because DMD is crucial for improving the coverage and correctness of memory reporters.\u00a0 There are several consequences of this.<\/p>\n<ul>\n<li>You no longer need to apply a patch to Firefox if you want to use DMD, you just have to configure with <code>--enable-dmd<\/code>.\u00a0 (Full instructions are <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=704400\">here<\/a>.)<\/li>\n<li>Any memory reporter written in the <a href=\"https:\/\/wiki.mozilla.org\/Platform\/Memory_Reporting\">new style<\/a> (i.e. using a <code>nsMallocSizeOfFun<\/code> function created with <code>NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN<\/code>) will automatically get coverage in DMD.<\/li>\n<li>DMD finds bugs in memory reporters, but it can also find bugs elsewhere.\u00a0 For example, this week it found that <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=707842\">some BaseShapes were being shared incorrectly<\/a>, which Brian Hackett fixed.<\/li>\n<\/ul>\n<p>I <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=705987\">updated the layout memory reporters to use the new style<\/a>.\u00a0 I also updated the <a href=\"https:\/\/wiki.mozilla.org\/Platform\/Memory_Reporting\">documentation on writing memory reporters<\/a>, to cover more complicated topics like how to measure classes that involve inheritance.\u00a0 I also added a request:\u00a0 if you write a memory reporter, please add me as a co-reviewer.<\/p>\n<p>Johnny Stenback implemented <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=704621\">per-window DOM memory reporters<\/a>, which gives much more detail for DOM memory usage in about:memory.\u00a0 Here&#8217;s an example:<\/p>\n<p><a href=\"http:\/\/blog.mozilla.org\/nnethercote\/files\/2011\/12\/dom-windows.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1525\" title=\"dom-windows\" src=\"http:\/\/blog.mozilla.org\/nnethercote\/files\/2011\/12\/dom-windows.png\" alt=\"per-window dom reporter output in about:memory\" width=\"854\" height=\"360\" srcset=\"https:\/\/blog.mozilla.org\/nnethercote\/files\/2011\/12\/dom-windows.png 854w, https:\/\/blog.mozilla.org\/nnethercote\/files\/2011\/12\/dom-windows-300x126.png 300w\" sizes=\"(max-width: 854px) 100vw, 854px\" \/><\/a><\/p>\n<h3>Memory Usage Improvements<\/h3>\n<p>Boris Zbarsky <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=700914\">lazily initialized some rulehash tables<\/a>, saving about 45KB per blank tab;\u00a0 this is a nice win for those people who have on-demand tab loading combined with sessions with many tabs.\u00a0 The same patch also made one of the rulehash tables smaller when it is initialized, which can cause multi-MB savings on workloads of only a few tabs.<\/p>\n<p>Bobby Holley fixed <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=708499\">a bad memory leak in xpconnect<\/a> that could cause unbounded amounts of memory to be leaked, albeit in somewhat unusual circumstances.\u00a0 The bug was only in Firefox 9 and Firefox 10;\u00a0 it&#8217;s been fixed for 10, and the patches to fix for 9 are ready to land.<\/p>\n<p>Fabrice Desr\u00e9 fixed a regression that caused a <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=707507\">zombie compartment when visiting addons.mozilla.org<\/a>.<\/p>\n<h3>Bug Counts<\/h3>\n<p>Here are the current bug counts.<\/p>\n<ul>\n<li>P1: 27 (-1\/+1)<\/li>\n<li>P2: 139 (-5\/+3)<\/li>\n<li>P3: 62 (-0\/+2)<\/li>\n<li>Unprioritized: 1 (-0\/+1)<\/li>\n<\/ul>\n<p>That&#8217;s a net change of +1, and we only had to triage seven bugs in today&#8217;s meeting.\u00a0 And if the trees hadn&#8217;t been <a href=\"https:\/\/groups.google.com\/forum\/#!topic\/mozilla.dev.platform\/wLHTg_moymM\">closed for the past few days<\/a> I could have fixed two more P2 bugs.<\/p>\n<p>Just for fun, I also counted the number of RESOLVED FIXED (i.e. genuine, not duplicates or invalid) MemShrink bugs.<\/p>\n<ul>\n<li>P1: 29<\/li>\n<li>P2: 70<\/li>\n<li>P3: 14<\/li>\n<li>Unprioritized: 35<\/li>\n<\/ul>\n<p>(If you&#8217;re wondering why the number of unprioritized fixed bugs is so high, it&#8217;s because MemShrink bugs are only prioritized in MemShrink meetings, which means that any bug that gets filed and fixed in less than 7 days doesn&#8217;t get prioritized.)<\/p>\n<p>So there are more bugs still open than have been fixed, but the rate of bug growth is close to zero.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s been six months since MemShrink started!\u00a0 Here are this week&#8217;s events of note. Memory Reporting I integrated DMD support into Firefox.\u00a0 This is a big deal because DMD is crucial for improving the coverage and correctness of memory reporters.\u00a0 There are several consequences of this. You no longer need to apply a patch to [&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,30,4544,4546],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/1524"}],"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=1524"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/1524\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/media?parent=1524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/categories?post=1524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/tags?post=1524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}