canmove, Confirmed users, Bureaucrats and Sysops emeriti
1,334
edits
(reorganize the tools section) |
(→Linux) |
||
| Line 118: | Line 118: | ||
=== Running the old-style leak tests === | === Running the old-style leak tests === | ||
The old-style tests can be run on any standard | The old-style tests can be run on any standard --enable-debug build, or on any --disable-debug build with --enable-logrefcnt. | ||
==== | ==== Mozilla Suite ==== | ||
# | # set the environment variable XPCOM_MEM_LEAK_LOG to leak.log (or XPCOM_MEM_BLOAT_LOG to bloat.log) | ||
# ./mozilla -f bloaturls.txt | # ./mozilla -f bloaturls.txt | ||
# Look at the top line of bloat.log or leak.log for the aggregate statistics (under headers Bytes/Leaked (for leaks) and Objects/Total (for | # Look at the top line of bloat.log or leak.log for the aggregate statistics (under headers Bytes/Leaked (for leaks) and Objects/Total (for "bloat"), and look at the other lines for the summary of objects. | ||
==== | ==== Firefox ==== | ||
# | # load resource:///res/bloatcycle.html and tell the popup blocker to allow popups from it | ||
# Edit the preferences file or use about:config to set the pref "dom.allow_scripts_to_close_windows" to true | |||
# | # set the environment variable XPCOM_MEM_LEAK_LOG to leak.log (or XPCOM_MEM_BLOAT_LOG to bloat.log) | ||
# ./firefox -no-remote resource:///res/bloatcycle.html | |||
# Look at the top line of bloat.log or leak.log for the aggregate statistics (under headers Bytes/Leaked (for leaks) and Objects/Total (for "bloat"), and look at the other lines for the summary of objects. | |||
# | |||
# | |||
# Look at the top line of bloat.log or leak.log for the aggregate statistics (under headers Bytes/Leaked (for leaks) and Objects/Total (for | |||
=== Reading the new-style leak stats === | === Reading the new-style leak stats === | ||
| Line 152: | Line 148: | ||
==== Linux ==== | ==== Linux ==== | ||
To build with trace-malloc enabled (--enable-trace-malloc in your mozconfig file). Then, once you have a build, | To build with trace-malloc enabled (--enable-trace-malloc in your mozconfig file). Then, once you have a build, use the same steps as the old-style leak tests, except don't set the environment variables, and instead add the command line options when invoking mozilla or firefox: "--trace-malloc=malloc.log" (or, if you want the shutdown leaks report, also add "--shutdown-leaks=sdleak.log"). Then, to process the log, run "./run-mozilla.sh ./leakstats malloc.log". (Omit the "./run-mozilla.sh" on Windows.) | ||
This will produce a report like the following: | This will produce a report like the following: | ||