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 1jQcFD-0000WR-S3 for pgsql-admin@arkaria.postgresql.org; Mon, 20 Apr 2020 19:38:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jQcFC-0001kN-Np for pgsql-admin@arkaria.postgresql.org; Mon, 20 Apr 2020 19:38:14 +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 1jQcFC-0001kG-GR for pgsql-admin@lists.postgresql.org; Mon, 20 Apr 2020 19:38:14 +0000 Received: from mout.perfora.net ([74.208.4.194]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jQcFA-0000SX-3X for pgsql-admin@postgresql.org; Mon, 20 Apr 2020 19:38:14 +0000 Received: from [192.168.1.143] ([98.169.208.7]) by mrelay.perfora.net (mreueus004 [74.208.5.2]) with ESMTPSA (Nemesis) id 1MnqT8-1ity7W3T9m-00pQ5A; Mon, 20 Apr 2020 21:37:52 +0200 Subject: Re: checkpoint process use too much memory To: Scott Ribe Cc: jian xu , Laurenz Albe , "pgsql-admin@postgresql.org" References: <5193b00d175f2e06a171ba375f1ef723e1700de4.camel@cybertec.at> From: MichaelDBA Message-ID: Date: Mon, 20 Apr 2020 15:37:48 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/7.0.12 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------DAD4202D0C6B1543EEC89FAE" Content-Language: en-US X-Provags-ID: V03:K1:+x99f33UzFR9yXccxKPK3czC2VDErUTo61fVd3Th4RnG1q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8+ZG8Rby4Yd+si58WtXk4trNhaf3Vz3nSkuTjTOdokeqGsDYd+Bh72YkG3p3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------DAD4202D0C6B1543EEC89FAE Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit You said: "the work_mem is 128MB, so they could use mostly 25GB memory," But work_mem is sometimes very deceiving based on types of queries executed.  You may need many work_mem buffers for a single query. So 8 buffers used = 1GB.  So it could conceivable surpass 25GB easily.  I would do some explaining on your SQL workload. Regards, Michael Vitale Scott Ribe wrote on 4/20/2020 3:23 PM: >> On Apr 20, 2020, at 1:13 PM, jian xu wrote: >> >> Do you mean the file cache will be counted in postgres checkpointer memory usage? > No, it won't be counted as PG memory. I just mean that free memory low is not a sign of a problem, when it's file cache. > > --------------DAD4202D0C6B1543EEC89FAE Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit You said: "the work_mem is 128MB, so they could use mostly 25GB memory,"

But work_mem is sometimes very deceiving based on types of queries executed.  You may need many work_mem buffers for a single query. So 8 buffers used = 1GB.  So it could conceivable surpass 25GB easily.  I would do some explaining on your SQL workload.

Regards,
Michael Vitale



Scott Ribe wrote on 4/20/2020 3:23 PM:
On Apr 20, 2020, at 1:13 PM, jian xu <jamesxu@outlook.com> wrote:

Do you mean the file cache will be counted in postgres checkpointer memory usage?
No, it won't be counted as PG memory. I just mean that free memory low is not a sign of a problem, when it's file cache.



--------------DAD4202D0C6B1543EEC89FAE--