• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
Firefox Developer Tools
  1. MDN
  2. Firefox Developer Tools
  3. Memory

Memory

The Memory tool lets you take a snapshot of the current tab's memory heap. It then provides a number of views of the heap that can show you which objects account for memory usage and exactly where in your code you are allocating memory.


The basics

  • Opening the memory tool
  • Taking a heap snapshot
  • Comparing two snapshots
  • Deleting snapshots
  • Saving and loading snapshots
  • Recording call stacks

Analyzing snapshots

The Tree map view is new in Firefox 48, and the Dominators view is new in FIrefox 46.

Once you've taken a snapshot, there are three main views the Memory tool provides:

  • the Tree map view shows memory usage as a treemap.
  • the Aggregate view shows memory usage as a table of allocated types.
  • the Dominators view shows the "retained size" of objects: that is, the size of objects plus the size of other objects that they keep alive through references.

If you've opted to record allocation stacks for the snapshot, the Aggregate and Dominators views can show you exactly where in your code allocations are happening.


Concepts

  • Dominators

Example pages

Examples used in the Memory tool documentation.

  • Monster example
  • DOM allocation example

Document Tags and Contributors

Tags: 
  • DevTools
  • Firefox
  • Mozilla
  • Tools
 Contributors to this page: bobsadino, chrisdavidmills, wbamberg, Sheppy
 Last updated by: bobsadino, Feb 25, 2017, 6:51:14 PM
  1. Core Tools
    1. Page Inspector
    2. Web Console
    3. JavaScript Debugger
    4. Network Monitor
    5. Performance
    6. Responsive Design Mode
    7. Tips
  2. More Tools
    1. Memory
    2. Storage Inspector
    3. DOM Property Viewer
    4. Developer Toolbar
    5. Eyedropper
    6. Screenshot
    7. Scratchpad
    8. Style Editor
    9. Shader Editor
    10. Web Audio Editor
  3. Connecting the devtools
    1. about:debugging
    2. Connecting to Firefox for Android
    3. Connecting to iframes
    4. Connecting to other browsers
  4. Debugging the browser
    1. Browser Console
    2. Browser Toolbox
  5. Extending the devtools
    1. Adding a panel to the toolbox
    2. Example devtools add-ons
    3. Remote Debugging Protocol
    4. Stream Transport
    5. Source Editor
    6. The Debugger Interface
    7. Web Console custom output
  6. Settings
  7. Release notes