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 1q9thw-0006ZP-Kb for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jun 2023 20:36:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q9thv-0007t4-HW for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jun 2023 20:36:39 +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 1q9thv-0007sB-88 for pgsql-hackers@lists.postgresql.org; Thu, 15 Jun 2023 20:36:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q9ths-002PQH-TW for pgsql-hackers@lists.postgresql.org; Thu, 15 Jun 2023 20:36:38 +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 35FKaXCT2275725; Thu, 15 Jun 2023 16:36:33 -0400 From: Tom Lane To: Tomas Vondra cc: Laurenz Albe , pgsql-hackers@lists.postgresql.org Subject: Re: Memory leak in incremental sort re-scan In-reply-to: <0643dbc2-53a6-37ac-b567-243a489cef0f@enterprisedb.com> References: <99e584a1-2f55-a56d-efb1-d38c57eb2beb@enterprisedb.com> <2267955.1686859883@sss.pgh.pa.us> <0643dbc2-53a6-37ac-b567-243a489cef0f@enterprisedb.com> Comments: In-reply-to Tomas Vondra message dated "Thu, 15 Jun 2023 22:30:58 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2275723.1686861393.1@sss.pgh.pa.us> Date: Thu, 15 Jun 2023 16:36:33 -0400 Message-ID: <2275724.1686861393@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tomas Vondra writes: > On 6/15/23 22:11, Tom Lane wrote: >> I see zero leakage in that example after applying the attached quick >> hack. (It might be better to make the check in the caller, or to just >> move the call to ExecInitIncrementalSort.) > Thanks for looking. Are you planning to work on this and push the fix, > or do you want me to finish this up? I'm happy to let you take it -- got lots of other stuff on my plate. regards, tom lane