Changes

Jump to: navigation, search

Performance:Leak Tools

1,092 bytes removed, 23:22, 8 October 2014
Cycle collector heap dump
The cycle collector heap dump is useful for figuring out why the cycle collector is keeping an object alive. These can either be manually or automatically generated. They can be generated in both debug and non-debug builds.
To manually generate a CC dump on Firefox 29 and up, go to about:memory and use the buttons under "Save GC & CC logs." "Save concise" will generate a smaller CC log, "Save verbose" will provide a more detailed CC log. To manually generate a CC dump prior to Firefox 29, enable the Error Console by going to about:config and setting devtools.errorconsole.enabled to true. Then open a new window, go to Tools, Web Developer, Web Console. Then evaluate this expression: window.QueryInterface(Components.interfaces.nsIInterfaceRequestor). getInterface(Components.interfaces.nsIDOMWindowUtils). cycleCollect(Components.classes["@mozilla.org/cycle-collector-logger;1"] .createInstance(Components.interfaces.nsICycleCollectorListener)) By default, the cycle collector will only log the objects it normally looks at. Sometimes it can be useful to disable the optimizations the cycle collector does in order to get more detailed information. In this case, the method allTraces() can be used: window.QueryInterface(Components.interfaces.nsIInterfaceRequestor). getInterface(Components.interfaces.nsIDOMWindowUtils). garbageCollect(Components.classes["@mozilla.org/cycle-collector-logger;1"] .createInstance(Components.interfaces.nsICycleCollectorListener).allTraces())
This creates a file named cc-edges-NNNN.log and writes a dump of the heap known to the cycle collector, which includes JS objects and also native C++ objects that participate in cycle collection, to the file. It will also log the contents of the Javascript heap to a file named gc-edges-NNNN.log.
Confirm
1,345
edits

Navigation menu