Re: checkpoint process use too much memory

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: jian xu <jamesxu(at)outlook(dot)com>
Cc: MichaelDBA <MichaelDBA(at)sqlexec(dot)com>, Scott Ribe <scott_ribe(at)elevated-dev(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: checkpoint process use too much memory
Date: 2020-07-20 22:08:47
Message-ID: 20200720220847.GA28454@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 2020-Jul-20, jian xu wrote:

> we are seeing this issue again, the checkpoint process is eating up all the memory,
> based on the htop, the checkpointer process has
> VIRT: 103G
> RES: 103G
> SHR: 4099M
> MEM%: 41%
>
> I use ps_mem.py to check the process,
> https://github.com/pixelb/ps_mem
> =================================
> Private + Shared = RAM used Program
>
> 99.5 GiB + 37.5 MiB = 99.5 GiB postgres
> ---------------------------------
> 99.5 GiB
> =================================
> my pg version is 10.3 , shared_buffer size is 4GB. work_mem 64MB. there are about 120 connections on the db side. most of them are idle.
> does anyone have idea how to troubleshooting this kind of issue?

I see no reason for checkpointer to use that much memory. Accounting
for the whole of shared_buffers is okay (as Laurenz explaijned), which
in other installations may account for several gigabytes of memory. But
if shared_buffers is 4GB, then 99GB is clearly overboard. I see no
explanation for checkpointer using 25x shared_buffers.

Maybe looking at /proc/<PID>/smaps would tell you where that memory is
going? Have a look there are see if you can figure out some obviously
absurd entries.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2020-07-20 22:34:25 Re: checkpoint process use too much memory
Previous Message jian xu 2020-07-20 21:33:55 Re: checkpoint process use too much memory