michael@0: michael@0: michael@0: michael@0: michael@0: Leak Gauge michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0:

Leak Gauge

michael@0: michael@0:
$Id: leak-gauge.html,v 1.8 2008/02/08 19:55:34 dbaron%dbaron.org Exp $
michael@0: michael@0:

This script is designed to help testers isolate and simplify testcases michael@0: for many classes of leaks (those that involve large graphs of core michael@0: data structures) in Mozilla-based browsers. It is designed to print michael@0: information about what has leaked by processing a log taken while michael@0: running the browser. Such a log can be taken over a long session of michael@0: normal browsing and then the log can be processed to find sites that michael@0: leak. Once a site is known to leak, the logging can then be repeated michael@0: to figure out under what conditions the leak occurs.

michael@0: michael@0:

The way to create this log is to set the environment variables:

michael@0:
  NSPR_LOG_MODULES=DOMLeak:5,DocumentLeak:5,nsDocShellLeak:5,NodeInfoManagerLeak:5
michael@0:   NSPR_LOG_FILE=nspr.log     (or any other filename of your choice)
michael@0:

in your shell and then run the program.

michael@0: michael@0: michael@0:

Once you have this log from a complete run of the browser (you have michael@0: to exit; otherwise it will look like everything leaked), you can load michael@0: this page (be careful not to overwrite the log when starting the browser michael@0: to load this page) and enter the filename of the log:

michael@0: michael@0:

michael@0: michael@0:

Then you'll see the output below, which will tell you which of michael@0: certain core objects leaked and the URLs associated with those michael@0: objects.

michael@0: michael@0: michael@0: