diff --git a/mozilla/tools/leaky/leaky.html b/mozilla/tools/leaky/leaky.html index 1ef3b132e15..ec91b2a715c 100644 --- a/mozilla/tools/leaky/leaky.html +++ b/mozilla/tools/leaky/leaky.html @@ -1,43 +1,55 @@
- - +To use leaky you must first build it. I've made it work only on x86 -linux. To work on other platforms you will need to: -
+ cvs checkout mozilla/tools/leaky ++If there is enough demand, we can make this part of +the default SeaMonkey module. +
+ ./configure --enable-leaky ++Top-of-tree build should Just Build It and leaky will show up in dist/bin. +
By setting the LIBMALLOC_LOG environment variable you control how much +
By setting the LIBMALLOC_LOG environment variable you control how much
information is logged during the programs execution. See libmalloc.h for
-a definition of the values to use. If you are using LD_PRELOAD, here is
+a definition of the values to use. If you are using LD_PRELOAD, here is
one way to run your program:
env LD_PRELOAD=/full/path/to/libleaky.so LIBMALLOC_LOG=1 my-program-The debugging malloc library creates two files - "malloc-log" and "malloc-map". +The debugging malloc library creates two files,
malloc-log and malloc-map.
The malloc-log file can be quite large for large programs (e.g. mozilla)
so be prepared to have alot of disk space. The malloc-map is tiny.
Once your program has completed execution you can use leaky to look
@@ -86,14 +98,11 @@ file of around 5 to 10 megabytes and the resulting converted log file will
be 10 to 20 times that so be prepared to have alot of disk space. It helps
a great deal to narrow down your problem space to reduce the log file size...
+
-
A quick additional note. Leaky now has a "graph" output option. -If you do this:
- -leaky -gqx viewer malloc-log | c++filt | sed -e 's/&/&/g' > /tmp/GQ0.html- +Leaky now has a "graph" output option. If you do this: +
+ leaky -gqx <program-name-goes-here> malloc-log | c++filt | sed -e 's/&/&/g' > /tmp/GQ0.html
Then leaky will make a graph of the leaks [-g] and output that graph in xml format (currently actually html...) [-x]. I use c++filt to translate the C++ mangled names into ascii and then use sed to make it @@ -103,5 +112,33 @@ legitimate html and off it goes to a file.
present you with a treeview of the leaks that you can click on to open/close sections. Enjoy! +Initial version works only on x86 linux. To work on other platforms you will need to: +
CrawlStack() in libmalloc.cppDumpAddressMap() in libmalloc.cpp and in ShowLibs.cpp