[webkit-dev] [GTK] Memory leak detection
brian.holt at samsung.com
Wed Jul 17 03:10:40 PDT 2013
This patch has proven itself as quite useful so far for finding and
resolving leaks. https://bugs.webkit.org/show_bug.cgi?id=116317 will remain
open as the metabug tracking leaks and a new bug
https://bugs.webkit.org/show_bug.cgi?id=118785 has been created to oversee
Comments and feedback welcome.
From: webkit-dev-bounces at lists.webkit.org
[mailto:webkit-dev-bounces at lists.webkit.org] On Behalf Of Brian Holt
Sent: 20 May 2013 15:49
To: webkit-dev at lists.webkit.org
Subject: [webkit-dev] [WIP][GTK] Memory leak detection
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
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
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"
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