Re: BUG #18675: Postgres is not realasing memory causing OOM

From: Maciej Jaros <eccenux(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #18675: Postgres is not realasing memory causing OOM
Date: 2024-10-28 18:07:45
Message-ID: 60f459d7-9cfc-4417-8944-a44581edbe4d@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

David G. Johnston (28.10.2024 14:42):
> On Monday, October 28, 2024, PG Bug reporting form
> <noreply(at)postgresql(dot)org> wrote:
>
> The following bug has been logged on the website:
>
> Bug reference:      18675
> Logged by:          Maciej Jaros
> Email address: eccenux(at)gmail(dot)com
> PostgreSQL version: 16.4
> Operating system:   Ubuntu 22.04
> Description:
>
>
> or maybe
> PostgreSQL should include garbage collection?
>
>
> Garbage collection is typically used in relation to a programming
> language feature to make writing applications in those languages
> easier.  Applications themselves don’t really implement garbage
> collection.  And C, the language PostgreSQL, is written in, doesn’t
> have garbage collection. To our knowledge, though, there are no
> significant memory leaks in supported versions.
>
>
> RAMforPG = shared_buffers + (temp_buffers + work_mem) *
> max_connections;
>
>
> The expression: work_mem * max_connections is incorrect.  See the doc
> for work_mem for how it is used.
>
> There is so much more info needed to conclude there is a bug here -
> which there probably is not.  Exploring the query and tuning the
> system is better discussed on the -general mailing list.
>
> David J.
>

Could you share what would be the correct expression to calculate or at
least estimate max RAM usage then? I've checked and haven't found
anything in the docs. I've found that expression in user space. I know
autovac might need to be accounted for, but as said we are not using it.
How would this estimation of 20GB go to 50GB?

There just seem to be no limit in RAM usage so it does seem like a
memory leak. It just grows until there is no more RAM available an we
restart the service. There are same operations, same connections
(pooling on the Java side) and it just grows everyday. It seem to be a
memory leak.It doesn't seem to have an end.

Red is "total" - "available" memory.

Maciej Nux.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Maciej Jaros 2024-10-28 18:16:47 Re: BUG #18675: Postgres is not realasing memory causing OOM
Previous Message Tom Lane 2024-10-28 15:42:46 Re: BUG #18676: Execute function while selecting from table with partial index using this function.