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 1oDRgs-0003R5-DT for pgsql-general@arkaria.postgresql.org; Mon, 18 Jul 2022 14:25:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oDRgr-0002mQ-4r for pgsql-general@arkaria.postgresql.org; Mon, 18 Jul 2022 14:25:41 +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 1oDRgq-0002in-PM for pgsql-general@lists.postgresql.org; Mon, 18 Jul 2022 14:25:40 +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 1oDRgo-0000ab-IB for pgsql-general@lists.postgresql.org; Mon, 18 Jul 2022 14:25:39 +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 26IEPaNH695844; Mon, 18 Jul 2022 10:25:36 -0400 From: Tom Lane To: =?UTF-8?B?QWxlxaEgWmVsZW7DvQ==?= cc: Tomas Vondra , Michael Paquier , "pgsql-generallists.postgresql.org" Subject: Re: PostgreSQL 14.4 ERROR: out of memory issues In-reply-to: References: Comments: In-reply-to =?UTF-8?B?QWxlxaEgWmVsZW7DvQ==?= message dated "Mon, 18 Jul 2022 16:05:25 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <695842.1658154336.1@sss.pgh.pa.us> Date: Mon, 18 Jul 2022 10:25:36 -0400 Message-ID: <695843.1658154336@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =?UTF-8?B?QWxlxaEgWmVsZW7DvQ==?= writes: > after some time, I've found a process consuming over 1GB of memory" > -bash-4.2$ grep RssAnon /proc/*/status | sort -nk2 | tail > /proc/17048/status:RssAnon: 1053952 kB > Here are memory contexts for PID 17048: > TopMemoryContext: 422592 total in 14 blocks; 42536 free (169 chunks); > 380056 used ... > Grand total: 14312808 bytes in 4752 blocks; 3920880 free (1043 chunks); > 10391928 used OK, so PG's normal memory consumption is only ~14MB. Where'd the rest of it go? > -bash-4.2$ pmap 17048 ... > 0000000002d93000 838092K rw--- [ anon ] > 00007fd999777000 180232K rw--- [ anon ] > 00007fd9a8d75000 32772K rw--- [ anon ] ... Probably the 838M chunk is shared memory? Is that within hailing distance of your shared_buffers setting? ... > 00007fd9b0551000 10827040K rw-s- zero (deleted) ... And here we have the culprit, evidently ... but what the dickens is it? I can't think of any mechanism within Postgres that would create such an allocation. regards, tom lane