Performance/MemShrink/about:memory: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Replaced content with "This page's contents have moved to [https://developer.mozilla.org/en-US/docs/Mozilla/Performance/about:memory MDN]")
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
about:memory is a special page that lets you view, save, load, and diff detailed measurements of Firefox's memory usage. It also lets you do other memory-related operations like trigger GC and CC,  dump GC & CC logs, and dump DMD reports.
This page's contents have moved to [https://developer.mozilla.org/en-US/docs/Mozilla/Performance/about:memory MDN]
 
Type "about:memory" into the browser's address bar to view it.
 
== Things that make your life easier ==
 
Almost everything you see in about:memory has an explanatory tool-tip. Hover over any button to see a description of what it does. Hover over any measurement to see a description of what it means.
 
You can copy and paste part or all of about:memory's contents into any text buffer. This is much easier than taking screenshots.
 
Memory reports are saved to file as gzipped JSON, and so have a .json.gz extension. These files can be loaded as is, but they can also be loaded after unzipping.
 
== Measurements ==
 
=== Basics ===
 
Most measurements use bytes as their unit, but some are counts or percentages.
 
Most measurements are presented within trees. For example:
 
  585 (100.0%) -- preference-service
  └──585 (100.0%) -- referent
    ├──493 (84.27%) ── strong
    └───92 (15.73%) -- weak
        ├──92 (15.73%) ── alive
        └───0 (00.00%) ── dead
 
This allows measurements to be broken down into further categories, sub-categories, sub-sub-categories, etc., as needed. The value of each internal node is the sum of all its children. All the measurements within a single tree are non-overlapping.
 
Tree paths can be written using '/' as a separator. For example, "preference/referent/weak/alive" indicates a one path to a leaf node in the above tree.
 
=== Sections ===
 
Memory reports are displayed on a per-process basis. Within each process's measurements, there are two sections.
 
* "Explicit Allocations". This tree measures all the memory allocated via explicit calls to heap allocation functions (such as <tt>malloc</tt> and <tt>new</tt>) and to non-heap allocations functions (such as <tt>mmap</tt> and <tt>VirtualAlloc</tt>).
* "Other Measurements". This collection of trees includes many that cross-cut the measurements in the "Explicit Allocations" tree. For example, in "Explicit Allocations" all DOM and layout measurements are segmented by window, but in "Other Measurements" those measurements are aggregated into totals for the whole browser.
 
Sub-trees can be collapsed or expanded by clicking on them. If you find any particular tree (especially "explicit") overwhelming, it can be helpful to collapse all the sub-trees immediately below the root, and then gradually expand the sub-trees of interest.
 
=== Notable measurements ===
 
The exact set of measurements shown in about:memory changes frequently. However, here are some notable ones.
 
* "explicit". This value is at the root of the tree in the "Explicit Allocations" section. As mentioned above, this represents all the memory allocated via explicit calls to allocation functions.
* "resident". Physical memory usage. If you want a single measurement to summarize memory usage, this is probably the best one.
* "vsize". Virtual memory usage.
* "heap-unclassified". This is heap-allocated memory that is not measured by any memory reporter. This is often 10--15% of "explicit". If it gets higher, it indicates that additional memory reporters should be added. [[Performance/MemShrink/DMD]] can be used to understand where these memory reporters should be added.

Latest revision as of 04:56, 21 October 2014

This page's contents have moved to MDN