Re: Add tracking of backend memory allocated to pg_stat_activity

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: Add tracking of backend memory allocated to pg_stat_activity
Дата
Msg-id 20220901.134320.188875425242927802.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на Add tracking of backend memory allocated to pg_stat_activity  (Reid Thompson <reid.thompson@crunchydata.com>)
Ответы Re: Add tracking of backend memory allocated to pg_stat_activity
Список pgsql-hackers
At Wed, 31 Aug 2022 12:03:06 -0400, Reid Thompson <reid.thompson@crunchydata.com> wrote in 
> Attached is a patch to 
> Add tracking of backend memory allocated to pg_stat_activity

> @@ -916,6 +930,7 @@ AllocSetAlloc(MemoryContext context, Size size)
>              return NULL;
>  
>          context->mem_allocated += blksize;
> +        pgstat_report_backend_mem_allocated_increase(blksize);

I'm not sure this is acceptable. The function adds a branch even when
the feature is turned off, which I think may cause a certain extent of
performance degradation. A past threads [1], [2] and [3] might be
informative.

[1] https://www.postgresql.org/message-id/1434311039.4369.39.camel%40jeff-desktop
[2] https://www.postgresql.org/message-id/72a656e0f71d0860161e0b3f67e4d771%40oss.nttdata.com
[3] https://www.postgresql.org/message-id/0271f440ac77f2a4180e0e56ebd944d1%40oss.nttdata.com

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [PATCH] Add native windows on arm64 support
Следующее
От: Justin Pryzby
Дата:
Сообщение: Re: pg15b3: recovery fails with wal prefetch enabled