Javascript:SpiderMonkey:HeapProfiling: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(First cut.)
 
(Mark as outdated.)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{OutdatedSpiderMonkey}}
Firefox should provide tools that web developers can use understand how their JavaScript code uses memory. Different analyses expose different aspects of the code's behavior:
Firefox should provide tools that web developers can use understand how their JavaScript code uses memory. Different analyses expose different aspects of the code's behavior:
<ul>
<ul>
Line 7: Line 9:
</ul>
</ul>


We are still researching what sorts of tools would be most valuable, how best to collect the data, and how to present it effectively. There exist Firefox plugins, based on internal heap tracing APIs, which Mozilla developers use to track down memory leaks, but these require familiarity with Firefox's internals to use.
We are still researching what sorts of tools would be most valuable, how best to collect the data, and how to present it effectively.
 
There exist Firefox plugins, based on internal heap tracing APIs, which Mozilla developers use to track down memory leaks, but these require familiarity with Firefox's internals to use.

Latest revision as of 21:14, 27 April 2021

Ambox outdated.png THIS PAGE IS OBSOLETE
This article is in parts, or in its entirety, outdated. Hence, the information presented on this page may be incorrect, and should be treated with due caution. Visit SpiderMonkey.dev for more up to date information.

Firefox should provide tools that web developers can use understand how their JavaScript code uses memory. Different analyses expose different aspects of the code's behavior:

  • What is my page spending memory on? Tools should show what portion of the page's memory usage each kind of object comprises. The tools should categorize objects by type, by prototype, and by the location of the JavaScript code that allocated them.
  • When does allocation occur? Tools should show how much allocation each portion of JavaScript code is responsible for.
  • How much memory does this entire data structure consume? By analyzing patterns of reference between objects, tools can show how much memory specific portions of the object graph consume.
  • Why is this particular object still alive? Tools should help developers find labeled paths from objects known to be live (say, the window object) to specific objects that the developer expected to be unreachable, but has learned (perhaps through the other tools) are still alive.

We are still researching what sorts of tools would be most valuable, how best to collect the data, and how to present it effectively.

There exist Firefox plugins, based on internal heap tracing APIs, which Mozilla developers use to track down memory leaks, but these require familiarity with Firefox's internals to use.