Performance:Leak Tools: Difference between revisions

m (oops)
Line 78: Line 78:


If you really need to debug leaks that involve JS objects closely, you can get detailed printouts of the paths JS uses to mark objects when it is determining the set of live objects by using the functions added in {{bug|378261}} and {{bug|378255}}.  (More documentation of this replacement for GC_MARK_DEBUG, the old way of doing it, would be useful.  It may just involve setting the XPC_SHUTDOWN_HEAP_DUMP environment variable to a file name, but I haven't tested that.)
If you really need to debug leaks that involve JS objects closely, you can get detailed printouts of the paths JS uses to mark objects when it is determining the set of live objects by using the functions added in {{bug|378261}} and {{bug|378255}}.  (More documentation of this replacement for GC_MARK_DEBUG, the old way of doing it, would be useful.  It may just involve setting the XPC_SHUTDOWN_HEAP_DUMP environment variable to a file name, but I haven't tested that.)
== Post-processing of stack traces ==
On Mac and Linux, the stack traces generated by our internal debugging tools don't have very good symbol information (since they just show the results of <code>dladdr</code>).  The stacks can be significantly improved (better symbols, and file name / line number information) by post-processing.  Stacks can be piped through the scripts <code>mozilla/tools/rb/fix-linux-stack.pl</code> or <code>mozilla/tools/rb/fix-macosx-stack.pl</code> to do this.  These scripts are designed to be run on balance trees in addition to raw stacks; since they are rather slow, it is often better to generate balance trees (e.g., using <code>make-tree.pl</code> for the refcount balancer or <code>diffbloatdump.pl --use-address</code> for trace-malloc) and ''then'' run the balance trees (which are much smaller) through the post-processing.
== Getting symbol information for system libraries ==
=== Windows ===
Setting the environment variable <code>_NT_SYMBOL_PATH</code> to something like <code>symsrv*symsrv.dll*f:\localsymbols*http://msdl.microsoft.com/download/symbols</code> as described in [http://support.microsoft.com/kb/311503 Microsoft's article].  This needs to be done when running, since we do the address to symbol mapping at runtime.
=== Linux ===
Many Linux distros provide packages containing external debugging symbols for system libraries.  fix-linux-stack.pl uses this debugging information (although it does not verify that they match the library versions on the system).
For example, on Fedora, these are in *-debuginfo RPMs (which are available in yum repositories that are disabled by default, but easily enabled by editing the system configuration).


== Leak statistics on tinderbox ==
== Leak statistics on tinderbox ==
canmove, Confirmed users, Bureaucrats and Sysops emeriti
1,334

edits