Re: One PG process eating more than 40GB of RAM and getting killed by OOM

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Jean-Christophe Boggio <postgresql(at)thefreecat(dot)org>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: One PG process eating more than 40GB of RAM and getting killed by OOM
Date: 2023-10-13 16:48:07
Message-ID: CAMkU=1wx43ex_RsQAH+zaTE5kCo1okoYsEWUaDOkHSJ87iD7Hg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, Oct 13, 2023 at 10:53 AM Jean-Christophe Boggio <
postgresql(at)thefreecat(dot)org> wrote:

> Le 13/10/2023 à 15:12, MichaelDBA a écrit :
>
> Turn off the OOM killer so you would get a nicer me ssage in PG log file
> instead of crashing the PG service.
>
> vm.overcommit_memory=2
>
> Did this and now the process dies much quicker (without seemingly consume
> all the available memory)... Also I can not launch thunderbird anymore with
> this setting...
>

Yes, turning off overcommit doesn't play with graphical environments, in my
experience. But a production database probably shouldn't be running on a
system like that. On non-prod systems, you can either turn it off
temporarily, or you could try to catch the problem before it becomes fatal
and get the log with pg_log_backend_memory_contexts.

> Anyway, I also reduced work_mem to 128Mb
>
> You can find the corresponding logs attached.
>
We can see what the problem is (over 137,000 concurrent tuple sorts), but
we can't tell what is ultimately causing it. You will need to dig into, or
disclose, the contents of the procedure.

Cheers,

Jeff

>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jean-Christophe Boggio 2023-10-13 19:12:02 Re: One PG process eating more than 40GB of RAM and getting killed by OOM
Previous Message Tom Lane 2023-10-13 15:02:04 Re: One PG process eating more than 40GB of RAM and getting killed by OOM