Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pQUwQ-0001ea-VZ for pgsql-general@arkaria.postgresql.org; Fri, 10 Feb 2023 15:03:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pQUwO-0003go-R7 for pgsql-general@arkaria.postgresql.org; Fri, 10 Feb 2023 15:03:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pQUwO-0003gd-GI for pgsql-general@lists.postgresql.org; Fri, 10 Feb 2023 15:03:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pQUwL-0007pS-Ka for pgsql-general@postgresql.org; Fri, 10 Feb 2023 15:03:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 31AF3q654076401; Fri, 10 Feb 2023 10:03:52 -0500 From: Tom Lane To: =?UTF-8?Q?Jon_Erdman?= cc: =?UTF-8?Q?pgsql-general=40postgresql=2Eorg?= Subject: Re: valgrind a background worker In-reply-to: <01010186386d97a3-f999e4c5-297d-4f89-a904-ced6f236ba6f-000000@us-west-2.amazonses.com> References: <01010186386d97a3-f999e4c5-297d-4f89-a904-ced6f236ba6f-000000@us-west-2.amazonses.com> Comments: In-reply-to =?UTF-8?Q?Jon_Erdman?= message dated "Thu, 09 Feb 2023 23:05:51 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4076399.1676041432.1@sss.pgh.pa.us> Date: Fri, 10 Feb 2023 10:03:52 -0500 Message-ID: <4076400.1676041432@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =?UTF-8?Q?Jon_Erdman?= 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