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 1lMjER-0001E1-Iy for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Mar 2021 03:21:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lMjEQ-0002x5-AY for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Mar 2021 03:21:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMjEQ-0002wy-30 for pgsql-hackers@lists.postgresql.org; Thu, 18 Mar 2021 03:21:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMjEN-00031d-Qo for pgsql-hackers@lists.postgresql.org; Thu, 18 Mar 2021 03:21:53 +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 12I3LlId3690610; Wed, 17 Mar 2021 23:21:47 -0400 From: Tom Lane To: Andres Freund cc: pgsql-hackers@lists.postgresql.org Subject: Re: Getting better results from valgrind leak tracking In-reply-to: <20210318030250.xlqxcppknzrakcs5@alap3.anarazel.de> References: <3471359.1615937770@sss.pgh.pa.us> <20210317023101.anvejcfotwka6gaa@alap3.anarazel.de> <3479700.1615950107@sss.pgh.pa.us> <3482163.1615953715@sss.pgh.pa.us> <20210318030250.xlqxcppknzrakcs5@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Wed, 17 Mar 2021 20:02:50 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3690608.1616037707.1@sss.pgh.pa.us> Date: Wed, 17 Mar 2021 23:21:47 -0400 Message-ID: <3690609.1616037707@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > The most glaring case is the RelationInitTableAccessMethod() call in > RelationBuildLocalRelation(). Seems like the best fix is to just move > the MemoryContextSwitchTo() to just before the > RelationInitTableAccessMethod(). Although I wonder if we shouldn't go > further, and move it to much earlier, somewhere after the rd_rel > allocation. Yeah, same thing I did locally. Not sure if it's worth working harder. > There's plenty other hits, but I think I should get back to working on > making the shared memory stats patch committable. I really wouldn't want > it to slip yet another year. +1, so far there's little indication that we're finding any serious leaks here. Might be best to set it all aside till there's more time. regards, tom lane