Re: Unexplained rapid growth in memory usage of idle backends

From: Erik Wienhold <ewie(at)ewie(dot)name>
To: Alex Balashov <abalashov(at)evaristesys(dot)com>, pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Unexplained rapid growth in memory usage of idle backends
Date: 2023-05-13 01:17:37
Message-ID: 346274191.318070.1683940657936@office.mailbox.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> On 13/05/2023 01:56 CEST Alex Balashov <abalashov(at)evaristesys(dot)com> wrote:
>
> > On May 12, 2023, at 7:38 PM, Erik Wienhold <ewie(at)ewie(dot)name> wrote:
> >
> > Function pg_log_backend_memory_contexts(pid int) may give you some insights on
> > on the memory allocation for specific backends.
> >
> > https://www.postgresql.org/docs/14/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL-TABLE
>
> Ah, thanks!
>
> 2023-05-12 23:53:23.293 UTC [3934125] eti_adm(at)eti LOG: level: 3; CachedPlanQuery: 2048 total in 2 blocks; 552 free (0 chunks); 1496 used
> 2023-05-12 23:53:23.293 UTC [3934125] eti_adm(at)eti LOG: level: 2; SPI Plan: 1024 total in 1 blocks; 600 free (0 chunks); 424 used
> 2023-05-12 23:53:23.293 UTC [3934125] eti_adm(at)eti LOG: level: 1; 828 more child contexts containing 2714624 total in 2097 blocks; 899280 free (329 chunks); 1815344 used
> 2023-05-12 23:53:23.293 UTC [3934125] eti_adm(at)eti LOG: level: 1; WAL record construction: 49768 total in 2 blocks; 6360 free (0 chunks); 43408 used
> 2023-05-12 23:53:23.293 UTC [3934125] eti_adm(at)eti LOG: level: 1; PrivateRefCount: 8192 total in 1 blocks; 2616 free (0 chunks); 5576 used
> 2023-05-12 23:53:23.293 UTC [3934125] eti_adm(at)eti LOG: level: 1; MdSmgr: 8192 total in 1 blocks; 5640 free (1 chunks); 2552 used
> 2023-05-12 23:53:23.293 UTC [3934125] eti_adm(at)eti LOG: level: 1; LOCALLOCK hash: 16384 total in 2 blocks; 4592 free (2 chunks); 11792 used
> 2023-05-12 23:53:23.293 UTC [3934125] eti_adm(at)eti LOG: level: 1; Timezones: 104120 total in 2 blocks; 2616 free (0 chunks); 101504 used
> 2023-05-12 23:53:23.293 UTC [3934125] eti_adm(at)eti LOG: level: 1; ErrorContext: 8192 total in 1 blocks; 7928 free (5 chunks); 264 used
> 2023-05-12 23:53:23.293 UTC [3934125] eti_adm(at)eti LOG: Grand total: 6417232 bytes in 2461 blocks; 2409920 free (468 chunks); 4007312 used
>
> But what can I learn from this that might be of applied value?

Narrowing down the memory contexts with high allocation. But I haven't used
this function before and would have to look up the memory context names.
I bet there are plenty of people on this list who can interpret the output.

But the log messages that you posted are not the entire output. The first line
should read "logging memory context if PID".

--
Erik

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message David G. Johnston 2023-05-13 01:33:49 Re: pgsql code is not working.
Previous Message Alex Balashov 2023-05-12 23:56:50 Re: Unexplained rapid growth in memory usage of idle backends