Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uvofh-0021DV-7Z for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Sep 2025 03:05:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uvofe-0096CY-CS for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Sep 2025 03:05:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uvofe-0096CP-4G for pgsql-bugs@lists.postgresql.org; Tue, 09 Sep 2025 03:05:26 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uvofc-001GSC-26 for pgsql-bugs@lists.postgresql.org; Tue, 09 Sep 2025 03:05:25 +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 589359eN1073616; Mon, 8 Sep 2025 23:05:09 -0400 From: Tom Lane To: feichanghong cc: =?utf-8?B?Iuadjua1t+a0iyjpmYznl5UpIg==?= , ocean_li_996 , "pgsql-bugs@lists.postgresql.org" Subject: Re: BUG #19040: Memory leak in hashed subplan node due to missing hashtempcxt reset In-reply-to: References: <19040-c9b6073ef814f48c@postgresql.org> <58062871.112.1990d3e06ea.Coremail.ocean_li_996@163.com> <808767.1756913726@sss.pgh.pa.us> <160523.1757190713@sss.pgh.pa.us> <507583.1757352192@sss.pgh.pa.us> <721997.1757364370@sss.pgh.pa.us> Comments: In-reply-to feichanghong message dated "Tue, 09 Sep 2025 10:51:56 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1073614.1757387109.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 08 Sep 2025 23:05:09 -0400 Message-ID: <1073615.1757387109@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk feichanghong writes: > For v04-0002, I checked the commit history, and before commit 133924e1, > buildSubPlanHash was using ecxt_per_tuple_memory. It seems that the > "Subplan HashTable Temp Context" was introduced in order to fix a certai= n bug. It was a different ExprContext's ecxt_per_tuple_memory, though. This one is owned locally by the TupleHashTable. regards, tom lane