Performance:Leak Tools: Difference between revisions

Jump to navigation Jump to search
(reorganize the tools section)
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 DEBUG build.
The old-style tests can be run on any standard --enable-debug build, or on any --disable-debug build with --enable-logrefcnt.


==== Unix (Linux/x86, Linux/ppc, Solaris/sparc, Solaris/x86) ====
==== Mozilla Suite ====


# setenv XPCOM_MEM_LEAK_LOG leak.log (or setenv XPCOM_MEM_BLOAT_LOG bloat.log)
# 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 �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 "bloat"), and look at the other lines for the summary of objects.


==== Windows ====
==== Firefox ====


# set XPCOM_MEM_LEAK_LOG=leak.log (or set XPCOM_MEM_BLOAT_LOG=bloat.log)
# load resource:///res/bloatcycle.html and tell the popup blocker to allow popups from it
# mozilla -f bloaturls.txt
# Edit the preferences file or use about:config to set the pref "dom.allow_scripts_to_close_windows" to true
# 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.
# 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
==== Mac ====
# 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.
 
# Create a file called environment in the same directory in dist:viewer_debug (alongside the MozillaDebug binary), and add XPCOM_MEM_LEAK_LOG=leak.log to the file (or add XPCOM_MEM_BLOAT_LOG=bloat.log)
# Run Mozilla Bloat URLs.
# 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.


=== 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, you can run:
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.)
 
# ./mozilla -f bloaturls.txt --trace-malloc=malloc.log (or, if you want the shutdown leaks report, also add --shutdown-leaks=sdleak.log)
# ./run-mozilla.sh ./leakstats malloc.log


This will produce a report like the following:
This will produce a report like the following:
canmove, Confirmed users, Bureaucrats and Sysops emeriti
1,334

edits

Navigation menu