From:  Kyle Huey <>
Date:  16 Jan 2016 03:11:38 Hong Kong Time

Re: Dominator tree memory analysis now in Nightly


This is awesome.  We've talked about how much we've wanted this since the early days of MemShrink back in 2011.  Thanks to everyone who was involved.

- Kyle

On Thu, Jan 14, 2016 at 1:50 PM, Nick Fitzgerald <> wrote:
Hi folks!

Dominator trees give you fine-grained insight into memory retention.

In a graph rooted by some node R, a node A is said to dominate B iff every path to B starting from R passes through A. In the context of a heap graph, another way to say this would be that A is retaining B: if the garbage collector found A to be unreachable and eligible for reclaiming, than B would also be unreachable and eligible for reclaiming.

We also use this to calculate the "true" memory cost of a node in the heap graph. This is the "retained size" and contrasts with the naive "shallow size". For example, imagine a large binary tree where there are no outside references into subtrees, only to the root. The root node itself has a small shallow size: a left branch pointer, a value, and a right branch pointer. However, it is retaining the whole rest of this large tree's structure, and so its retained size is significant.

Here is a screenshot of the dominator tree (combined with allocation stack tracking) in action to debug the memory overhead of loading large source files in a CodeMirror editor:

And here is a reminder of how to enable to memory tool within the devtools:

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:

Please try it out, give me your feedback, and file bugs in the "Firefox" product and "Developer Tools: Memory" component!

My thanks to the folks who reviewed patches for this feature: Jordan Santell, Steve Fink, Boris Zbarsky, and Jim Blandy.



firefox-dev mailing list