From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jon Erdman <jon@thewickedtribe.net>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: valgrind a background worker
Date: Fri, 10 Feb 2023 10:03:52 -0500
Message-ID: <4076400.1676041432@sss.pgh.pa.us> (raw)
In-Reply-To: <01010186386d97a3-f999e4c5-297d-4f89-a904-ced6f236ba6f-000000@us-west-2.amazonses.com>
References: <fa76824b-f1c9-5fa6-7e0d-cbe092460643@thewickedtribe.net>
<01010186386d97a3-f999e4c5-297d-4f89-a904-ced6f236ba6f-000000@us-west-2.amazonses.com>
=?UTF-8?Q?Jon_Erdman?= <jon@thewickedtribe.net> writes:
> I've got a background worker that has a slow memory leak in it
> somewhere. How can I get it to start under valgrind to get a memcheck
> output from it?
You have to valgrind the whole cluster AFAIK. Basically, start
the postmaster under valgrind with --trace-children=yes.
For leak tracking you probably also want
--leak-check=full --track-origins=yes --read-var-info=yes
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, jon@thewickedtribe.net
Subject: Re: valgrind a background worker
In-Reply-To: <4076400.1676041432@sss.pgh.pa.us>
References: <fa76824b-f1c9-5fa6-7e0d-cbe092460643@thewickedtribe.net> <01010186386d97a3-f999e4c5-297d-4f89-a904-ced6f236ba6f-000000@us-west-2.amazonses.com> <4076400.1676041432@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox