Backed out changeset 5c7de47bcacb (bug 1927094) for causing Bug 1928689. a=backout
[gecko.git] / docs / performance / memory / memory.md
blobd571fb6b9c2be11717ff5968c52b06d7e199671e
1 # Memory Tools
3 The Memory tool lets you take a snapshot of the current tab's memory
4 [heap](https://en.wikipedia.org/wiki/Memory_management#HEAP).
5 It then provides a number of views of the heap that can
6 show you which objects account for memory usage and exactly where in
7 your code you are allocating memory.
9 <iframe width="595" height="325" src="https://www.youtube.com/embed/DJLoq5E5ww0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"></iframe>
11 ------------------------------------------------------------------------
13 ## The basics
14 -   Opening [the memory
15     tool](basic_operations.md#opening-the-memory-tool)
16 -   [Taking a heap
17     snapshot](basic_operations.md#saving-and-loading-snapshots)
18 -   [Comparing two
19     snapshots](basic_operations.md#comparing-snapshots)
20 -   [Deleting
21     snapshots](basic_operations.md#clearing-a-snapshot)
22 -   [Saving and loading
23     snapshots](basic_operations.md#saving-and-loading-snapshots)
24 -   [Recording call
25     stacks](basic_operations.md#recording-call-stacks)
27 ------------------------------------------------------------------------
29 ## Analyzing snapshots
31 The Tree map view is new in Firefox 48, and the Dominators view is new
32 in Firefox 46.
34 Once you've taken a snapshot, there are three main views the Memory
35 tool provides:
37 -   [the Tree map view](tree_map_view.md) shows
38     memory usage as a
39     [treemap](https://en.wikipedia.org/wiki/Treemapping).
40 -   [the Aggregate view](aggregate_view.md) shows
41     memory usage as a table of allocated types.
42 -   [the Dominators view](dominators_view.md)
43     shows the "retained size" of objects: that is, the size of objects
44     plus the size of other objects that they keep alive through
45     references.
47 If you've opted to record allocation stacks for the snapshot, the
48 Aggregate and Dominators views can show you exactly where in your code
49 allocations are happening.
51 ------------------------------------------------------------------------
53 ## Concepts
55 -   What are [Dominators](dominators.md)?
57 ------------------------------------------------------------------------
59 ## Example pages
61 Examples used in the Memory tool documentation.
63 -   The [Monster example](monster_example.md)
64 -   The [DOM allocation example](DOM_allocation_example.md)