[webkit-dev] [WIP][GTK] Memory leak detection
brian.holt at samsung.com
Mon May 20 07:48:51 PDT 2013
Memory leak detection is a recurrent topic on this mailing list [1-5] but at present there exists only support for the Mac leaks tool. The de facto standard for memory checking and leak detection for Unix is Valgrind and the goal of this work is to launch the DRT under Valgrind to generate a xml file with details of leaks found, and then to parse this file and display this information.
Failures should result in the filing of memory bugs and adding the error to the suppression file. Chromium has a fairly mature process for this which can been taken as the starting point.
This work is being tracked under https://bugs.webkit.org/show_bug.cgi?id=116317.
This is a work in progress, but as a first attempt leak checking can be done using the existing run-webkit-tests script as follows:
$ Tools/Scripts/run-webkit-tests --gtk --leak --wrapper="valgrind" LayoutTests/accessibility/accessibility-node-memory-management.html
The wrapper argument is used as a workaround because the the existing hooks "check_for_leaks" and "print_leaks_summary" happen *after* the test has finished running, while we need to launch the test already under Valgrind. Valgrind options are passed by setting VALGRIND_OPTS, but could be changed to use a configuration file instead.
At present only minimal changes have been made to the Mac-specific leak code. In a subsequent bug, perhaps the run-leaks perl script that checks for leaks on Mac can be refactored into a "wrapper" that chooses which platform-dependent script to run, so there could be a run-gtk-leaks, run-mac-leaks, with run-leaks picking the right one.
Comments and feedback welcome!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev