Performance:Leak Tools: Difference between revisions

Jump to navigation Jump to search
Line 128: Line 128:
Generate a trace-malloc dump by building with <code>ac_add_options --enable-trace-malloc</code> and then passing <code>--trace-malloc FILENAME</code> when you start Firefox.
Generate a trace-malloc dump by building with <code>ac_add_options --enable-trace-malloc</code> and then passing <code>--trace-malloc FILENAME</code> when you start Firefox.


==== Valgrind ====
==== Valgrind, LSAN and Apple tools ====


[http://valgrind.org/ Valgrind] is a free tool for Linux and Mac that detects various kinds of memory-related errors at runtime, including leaks. Documentation on how to use it with Mozilla code is [https://developer.mozilla.org/en-US/docs/Mozilla/Testing/Valgrind here]. Valgrind is used as [https://developer.mozilla.org/en-US/docs/Valgrind_test_job part] of Mozilla's continuous integration testing, though the coverage is limited because Valgrind is slow.
These are documented on [https://developer.mozilla.org/en-US/docs/Mozilla/Performance MDN].
 
==== LSAN ====
[https://code.google.com/p/address-sanitizer/wiki/LeakSanitizer LeakSanitizer] (a.k.a. LSAN) is similar to Valgrind, but it runs faster because it uses static source code instrumentation. LSAN is part of Mozilla's continuous integration testing, with most tests running through it as part of the AddressSanitizer (a.k.a. ASAN) test jobs.
 
==== Apple tools ====
 
Apple provides [http://developer.apple.com/documentation/Performance/Conceptual/ManagingMemory/Articles/FindingLeaks.html some tools] for Mac OS X that probably report similar problems to those reported by LSAN and Valgrind.  The "leaks" tool is not recommended for use with SpiderMonkey or Firefox, because it gets confused by tagged pointers and thinks objects have leaked when they have not (see {{bug|390944}}).


=== Leak tools for debugging memory growth that is cleaned up on shutdown ===
=== Leak tools for debugging memory growth that is cleaned up on shutdown ===
Confirmed users
1,345

edits

Navigation menu