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 1qrJg3-003fCn-Ta for pgsql-admin@arkaria.postgresql.org; Fri, 13 Oct 2023 15:02:11 +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 1qrJg0-001pN0-MD for pgsql-admin@arkaria.postgresql.org; Fri, 13 Oct 2023 15:02:09 +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 1qrJg0-001pLv-B7 for pgsql-admin@lists.postgresql.org; Fri, 13 Oct 2023 15:02:09 +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.94.2) (envelope-from ) id 1qrJfy-000JEZ-Ki for pgsql-admin@lists.postgresql.org; Fri, 13 Oct 2023 15:02:07 +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 39DF24t81528963; Fri, 13 Oct 2023 11:02:04 -0400 From: Tom Lane To: Jean-Christophe Boggio cc: pgsql-admin@lists.postgresql.org Subject: Re: One PG process eating more than 40GB of RAM and getting killed by OOM In-reply-to: References: <1018f9c0-9d14-4146-b7e9-24c48ea29e1d@thefreecat.org> <897a43b3-60d0-2417-f821-9299fd204c1d@sqlexec.com> Comments: In-reply-to Jean-Christophe Boggio message dated "Fri, 13 Oct 2023 16:31:21 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1528961.1697209324.1@sss.pgh.pa.us> Date: Fri, 13 Oct 2023 11:02:04 -0400 Message-ID: <1528962.1697209324@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jean-Christophe Boggio writes: > You can find the corresponding logs attached. Your query seems to be creating TupleSort contexts and then leaking them, which is surely a bug. Can you make a self-contained test case that reproduces this? regards, tom lane