Re: Postgres connection growing memory usage over time! This right after the connections in the pool are closed and opened again. - Mailing list pgsql-bugs

From Andres Freund
Subject Re: Postgres connection growing memory usage over time! This right after the connections in the pool are closed and opened again.
Date
Msg-id 20230110204711.xntfwpvatv4el6yr@awork3.anarazel.de
Whole thread Raw
In response to Postgres connection growing memory usage over time! This right after the connections in the pool are closed and opened again.  (Ron Wilson <ronw@consultzen.com>)
List pgsql-bugs
Hi,

On 2023-01-09 16:50:03 -0600, Ron Wilson wrote:
> The JSON query above was isolated to a single connection to trace the issue
> better.

> You can see in the image below that there is one connection that is growing
> memory usage over time and the rest are not.
> [image: Screen Shot 2023-01-09 at 4.22.48 PM.png]
> This image shows the memory growing on that single connection that the JSON
> is processed and the other connections that the memory used is stable and
> not growing.  This is just before the connections are closed and opened
> again in the pool.
> [image: Screen Shot 2023-01-09 at 4.25.00 PM.png]

The easiest way (for us) to debug this further would be if you could provide
us with a memory context dump. Unfortunately in PG 13 the
pg_backend_memory_contexts view does not yet exist. So you'd have to gdb into
the backend, and execute
  p MemoryContextStats(TopMemoryContext)
which will dump information to the server's stderr.

Greetings,

Andres Freund



pgsql-bugs by date:

Previous
From: Anbazhagan M
Date:
Subject: Re: BUG #17740: Connecting postgresql 13 with different psql versions
Next
From: Tom Lane
Date:
Subject: Re: [OT] Microsoft: Kubernetes clusters hacked in malware campaign via PostgreSQL