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 20220907.171730.70660004495346027.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на Re: Add tracking of backend memory allocated to pg_stat_activity  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-hackers
At Wed, 07 Sep 2022 17:08:41 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in
> At Tue, 06 Sep 2022 17:10:49 -0400, Reid Thompson <reid.thompson@crunchydata.com> wrote in
> > On Thu, 2022-09-01 at 13:43 +0900, Kyotaro Horiguchi wrote:
> > >
> > > > @@ -916,6 +930,7 @@ AllocSetAlloc(MemoryContext context, Size size)
> > > >               return NULL;
> > > >  
> > > >           context->mem_allocated += blksize;
> > > > +        pgstat_report_backend_mem_allocated_increase(blksi
> > > > ze);
> > >
> > > 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.
> >
> >  Stated above is '...even when the feature is turned off...', I want to
> >  note that this feature/patch (for tracking memory allocated) doesn't
> >  have an 'on/off'. Tracking would always occur.
>
> In the patch, I see that
> pgstat_report_backend_mem_allocated_increase() runs the following
> code, which seems like to me to be a branch..

Ah.. sorry.

> pgstat_report_backend_mem_allocated_increase() runs the following
- code, which seems like to me to be a branch..
+ code, which seems like to me to be a branch that can turn of the feature..

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Handle infinite recursion in logical replication setup
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [RFC] building postgres with meson - v12