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 1l2Ml6-0004QK-K8 for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Jan 2021 23:19:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l2Ml4-0007V7-Tj for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Jan 2021 23:19:26 +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 1l2Ml4-0007Uu-MZ for pgsql-bugs@lists.postgresql.org; Wed, 20 Jan 2021 23:19:26 +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 1l2Mkx-00060b-35 for pgsql-bugs@lists.postgresql.org; Wed, 20 Jan 2021 23:19: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 10KNJGf7792461; Wed, 20 Jan 2021 18:19:16 -0500 From: Tom Lane To: yli@rsa.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16831: Idle postgres processes on Linux consumes huge amount of memory In-reply-to: <16831-c341255cd0d97a74@postgresql.org> References: <16831-c341255cd0d97a74@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Wed, 20 Jan 2021 21:04:56 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <792459.1611184756.1@sss.pgh.pa.us> Date: Wed, 20 Jan 2021 18:19:16 -0500 Message-ID: <792460.1611184756@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > We are still using postgresql 9.4.1, however, it looks the same issue as in > 9.5 as someone reported: > https://www.postgresql.org/account/reset/NzAyMjY-5ng-2bb43dc39c9c2c644a7a/ That link's not too helpful: it leads to a "password reset" form. > The postgres process consume huge memory as following for the same database > size > PID=6840 - Swap used: 145860 KB - (postgres) > PID=6842 - Swap used: 142564 KB - (postgres) > PID=6841 - Swap used: 141620 KB - (postgres) Almost invariably, when we hear reports like this, the true reason is somebody misunderstanding the numbers they are looking at. Many Unix tools such as "top" will count the shared memory segment as memory consumed by each Postgres process, even though in reality there's only one copy of the shared memory. I don't know what these "Swap used" numbers are coming out of, but it'd be wise to check into how the tool accounts for shared memory before putting much faith in them. regards, tom lane