File: index.rst

package info (click to toggle)
firefox 143.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,617,328 kB
  • sloc: cpp: 7,478,492; javascript: 6,417,157; ansic: 3,720,058; python: 1,396,372; xml: 627,523; asm: 438,677; java: 186,156; sh: 63,477; makefile: 19,171; objc: 13,059; perl: 12,983; yacc: 4,583; cs: 3,846; pascal: 3,405; lex: 1,720; ruby: 1,003; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 53; csh: 10
file content (85 lines) | stat: -rw-r--r-- 2,711 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
================
Basic operations
================


.. _memory-basic-operations-taking-a-heap-snapshot:

Taking a heap snapshot
**********************

To take a snapshot of the heap, click the "Take snapshot" button, or the camera icon on the left:

.. image:: memory-1-small.png
  :class: center

The snapshot will occupy the large pane on the right-hand side. On the left, you'll see an entry for the new snapshot, including its timestamp, size, and controls to save or clear this snapshot:

.. image:: memory-2-small.png
  :class: center


.. _memory-basic-operations-clearing-a-snapshot:

Clearing a snapshot
*******************

To remove a snapshot, click the "X" icon:

.. image:: memory-3-small.png
  :class: center


.. _memory-basic-operations-saving-and-loading-snapshots:

Saving and loading snapshots
****************************

If you close the Memory tool, all unsaved snapshots will be discarded. To save a snapshot click "Save":

.. image:: memory-4-small.png
  :class: center

You'll be prompted for a name and location, and the file will be saved with an ``.fxsnapshot`` extension.

To load a snapshot from an existing ``.fxsnapshot`` file, click the import button, which looks like a rectangle with an arrow rising from it:

.. image:: memory-5-small.png
  :class: center

You'll be prompted to find a snapshot file on disk.


.. _memory-basic-operations-comparing-snapshots:

Comparing snapshots
*******************

You can diff two heap snapshots. The diff shows you where memory was allocated or freed between the two snapshots.

To create a diff, click the button that looks like a Venn diagram next to the camera icon:

.. image:: memory-6-small.png
  :class: center

You'll be prompted to select the snapshot to use as a baseline, then the snapshot to compare. The tool then shows you the differences between the two snapshots:

.. raw:: html

  <iframe width="560" height="315" src="https://www.youtube.com/embed/3Ow-mdK6b2M" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
  <br/>
  <br/>

.. note::
  When you're looking at a comparison, you can't use the Dominators view or the Tree Map view.


.. _memory-basic-operations-recording-call-stacks:

Recording call stacks
*********************

The Memory tool can tell you exactly where in your code you are allocating memory. However, recording this information has a run-time cost, so you must ask the tool to record memory calls *before* the memory is allocated, if you want to see memory call sites in the snapshot. To do this, check "Record call stacks":

.. image:: memory-7-small.png
  :class: center