From: Erik Wienhold <ewie@ewie.name>
To: Alex Balashov <abalashov@evaristesys.com>
To: pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Unexplained rapid growth in memory usage of idle backends
Date: Sat, 13 May 2023 03:17:37 +0200 (CEST)
Message-ID: <346274191.318070.1683940657936@office.mailbox.org> (raw)
In-Reply-To: <7402BB66-E774-405D-8F75-86142239194F@evaristesys.com>
References: <2D17E15D-8D5B-4DF7-A238-12455C2731D8@evaristesys.com>
<729198445.317848.1683934680067@office.mailbox.org>
<7402BB66-E774-405D-8F75-86142239194F@evaristesys.com>
> On 13/05/2023 01:56 CEST Alex Balashov <abalashov@evaristesys.com> wrote:
>
> > On May 12, 2023, at 7:38 PM, Erik Wienhold <ewie@ewie.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@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@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@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@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@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@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@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@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@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@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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: ewie@ewie.name, abalashov@evaristesys.com, pgsql-admin@lists.postgresql.org
Subject: Re: Unexplained rapid growth in memory usage of idle backends
In-Reply-To: <346274191.318070.1683940657936@office.mailbox.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox