From: Kristian Nielsen Date: March 17 2009 6:50am Subject: Re: Valgrind, MySQL - a single query mem check List-Archive: http://lists.mysql.com/internals/36403 Message-Id: <87zlfk4p84.fsf@knielsen-hq.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Patrick Lau writes: > But my mysqld is built with the config option --without-query-cache... > > Is it really the query cache or can it also be our own stuff allocated > with my_malloc? Sorry I meant _key cache_ of course. As seen in this call on the stack trac= e: >>> =3D=3D13045=3D=3D =C2=A0 =C2=A0by 0x820BC12: _ZL16create_key_cachePKcj = (set_var.cc:3586) Generally, for each leak (or non-leak in the case of "still reachable"), Valgrind will show the stack trace of where the memory was allocated, which should help you determine if and how it is related to your code. Also, I would suggest running your query several times, and only look at the Valgrind reports from VALGRIND_DO_LEAK_CHECK starting after a few queries h= ave been run, to get one-time initialisations like this one to settle down. - Kristian.