Changes

Jump to: navigation, search

Performance:Leak Tools

2,240 bytes removed, 03:46, 28 October 2014
Leaksoup
==== Leaksoup ====
Leaksoup is a trace-malloc tool that analyzes the log from trace-malloc's secondary feature, the ability to dump allocations. (See below for more information documented on using trace-malloc.) trace-malloc's main log is a log that contains information about all allocations and the stacks at which they were allocated and freed, but it also has the ability to dump, at a given time (including shutdown), all the currently live allocations, the stacks at which they were allocated, ''and the contents of the memory''. This last feature allows leaksoup to analyze the graph of live objects and determine which allocations are roots (within that graph, of course -- stack allocations and global variables don't count). Leaksoup also finds sets of objects that are rooted by a cycle (i.e., a set of reference counted objects that own references to each other in a cycle). However, it cannot distinguish between owning and non-owning pointers, which means that non-owning pointers that are nulled out by destructors may show up in leaksoup as cycles. However, despite that, it is probably the easiest way to determine what leak roots are present. You need a build with --enable-trace-malloc. Without this option, you can't create a dump and leaksoup isn't built. Run using ''both'' the --trace-malloc and --shutdown-leaks options, for example "./mozilla -P default --trace-malloc=malloc.log --shutdown-leaks=sdleak.log". Ignore the malloc.log file (unless you're interested in other trace-malloc tools, such as [httphttps://developer.mozilla.org/projectsen-US/footprintdocs/spaceTrace.html SpaceTrace]). Then run leaksoup over the memory dump (which is a dump of all allocations still live at shutdown) with a command such as .Mozilla/run-mozilla.sh .Performance/leaksoup sdleak.log > sdleak.html. This generates a ''large'' HTML file as output. The output of leaksoup begins with all the leak roots, and then lists all the non-root allocations. The roots are either listed as single objects or as strongly connected components (minimal sets of nodes in the graph in which any node is reachable from all other nodes). (A strongly connected component with only one node is listed as a single object.) Any single object listed as a root is really a leak root, and any component listed as a root either (a) contains an object that is a root or (b) contains objects that form an ownership cycle that is a rootTraceMalloc#Leaksoup MDN].
=== Leak tools for simple objects and summary statistics ===
Confirm
1,345
edits

Navigation menu