From:  Wilson Page <wpage@mozilla.com>
Date:  04 Nov 2015 18:51:23 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

This looks like a really valuable tool Nick! It's really cool that you can reference memory back to real, familiar object names, haven't seen anything like this before :)

I assume we can use it via the WebIDE Devtools?

Can't wait to try it out!

W I L S O N  P A G E

Front-end Developer
Firefox OS (Gaia)
London Office

Twitter: @wilsonpage
IRC: wilsonpage


On Tue, Nov 3, 2015 at 10:32 PM, Nick Fitzgerald <nfitzgerald@mozilla.com> wrote:
Hi folks!

(Jordan Santell made an announcement on the devtools mailing list[0], but I
thought I'd spread the word around.)

The first iteration of the new heap snapshots memory tools landed on m-c in
the middle of the last cycle and rode the train to Developer Edition with
the merge.

This tool is built on top of JS::ubi::Node[1] which is an API to do
analyses on the heap graph as the GC sees it, and the SavedFrame JS stack
recording[2].

In this first release, the most notable feature is capturing the JS stack
when objects are allocated so that you can see exactly where your retained
objects are coming from. The downside is that this incurs overhead and you
have to start recording allocation stacks *before* you start saving heap
snapshot. You can also disect the heap into various other buckets.

http://i.imgur.com/QrcrtWq.png

This initial version is very much just getting something out the door and
there is a ton more coming down the pipe. Filtering/searching and diffing
snapshots are in the works at the moment. Currently, we don't take
advantage of our full access to every node and edge in the heap graph.
Soon, we will compute dominator trees to find "deep" size / retention as
well as find the first N shortest paths from GC roots to objects of
interest. We are also planning on adding support for cycle collected nodes
and edges to the JS::ubi::Node graph.

You can enable the new tool by going to the settings panel of the devtools
and checking the "Memory" checkbox on the left underneath "Default Firefox
Developer Tools".

http://i.imgur.com/hEPTqrT.png

If you would like to use this tool for the whole runtime rather than scoped
to a single tab, use the browser toolbox. Here are instructions for
enabling and using the browser toolbox:
https://developer.mozilla.org/en-US/docs/Tools/Browser_Toolbox

Please try it out and file bugs in the "Firefox" product and "Developer
Tools: Memory" component! We want this to be a useful tool for _you_!

Thanks,

Nick

[0]
https://groups.google.com/d/msg/mozilla.dev.developer-tools/TIehyWbmXiQ/g-iLjF3eAgAJ

[1]
https://dxr.mozilla.org/mozilla-central/rev/59a6ad6a921f4809dfc37d943d765300c65721e5/js/public/UbiNode.h#31-163

[2]
https://dxr.mozilla.org/mozilla-central/rev/59a6ad6a921f4809dfc37d943d765300c65721e5/js/src/vm/SavedStacks.h#21-148
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform