From:  Nick Fitzgerald <nfitzgerald@mozilla.com>
Date:  05 Nov 2015 03:24:20 Hong Kong Time
Newsgroup:  news.mozilla.org/mozilla.dev.memory
Subject:  

Re: New heap snapshots tool in the developer tools

NNTP-Posting-Host:  63.245.214.181

​On Wed, Nov 4, 2015 at 11:07 AM, David Rajchenbach-Teller <dteller@mozilla.com> wrote:
That sounds very useful.

Any chance we can get the same kind of output on the console in case of
mochitest memory leak?


​You can use `[ThreadSafe]Chrome​Utils.saveHeapSnapshot`[0] to programmatically save a heap snapshot file. This tool is using that under the covers right now, but we don't yet expose importing and exporting these files in the UI. It is pretty high priority to add soon.

So yes, we could definitely programmatically save a heap snapshot file at the end of a mochitest if we detect a leak. A tiny bit more work needed on the tool's frontend to import a saved snapshot.

​[0] ​
h
​​
ttps://dxr.mozilla.org/mozilla-central/rev/f742b9412ed5aace90ad863b276faae0641090a8/dom/webidl/ThreadSafeChromeUtils.webidl#13-25,36-66