Performance/MemShrink/DMD: Difference between revisions

Line 121: Line 121:
=== Desktop ===
=== Desktop ===


To trigger DMD's analysis phase, create a bookmark with the following location:
If you are on a sufficiently recent build, to trigger DMD's analysis phase, visit about:memory and click the "DMD" button. (The button won't be present in non-DMD builds, and will be grayed out in DMD builds if DMD wasn't enabled at start-up.)
 
If you are on an older build, create a bookmark with the following location:


   javascript:DMDReportAndDump("out.dmd")
   javascript:DMDReportAndDump("out.dmd")


(You can choose a different filename than <code>out.dmd</code>.)
and click that instead. Note that this silently fails on certain special pages such as about:memory or an empty tab.


Clicking on it triggers a run of all the memory reporters and then invokes DMD analysis of the reports, which triggers this commentary:
Both actions invoke all the memory reporters and then DMD analyzes the reports, printing this commentary:


   DMD: running reporters...
   DMD: running reporters...
Line 139: Line 141:
   DMD[11420] }
   DMD[11420] }


The output file will be written to the current working directory.
The output be written to a file called <code>out.dmd</code> in the current working directory.
 
If nothing happens when you click the bookmark, it may be because it doesn't work if you are viewing certain pages such as about:memory or an empty tab. If that happens in a debug build you'll get a console warning like this:
 
  WARNING: No principal to execute JS with: file /home/njn/moz/mi2/dom/src/jsurl/nsJSProtocolHandler.cpp, line 157
 
Just try clicking it while viewing a normal web content page.


On Linux the analysis is fast.  On Mac it can take 30+ seconds.
On Linux the analysis is fast.  On Mac it can take 30+ seconds.
You can run <tt>DMDReportAndDump</tt> multiple times in a single session, but note that subsequent runs will overwrite the file unless you change the bookmark appropriately.


=== Fennec ===
=== Fennec ===
Confirmed users
1,345

edits