Re: Add tracking of backend memory allocated to pg_stat_activity

From: Ted Yu <yuzhihong(at)gmail(dot)com>
To: reid(dot)thompson(at)crunchydata(dot)com
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org, "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>, Melanie Plageman <melanieplageman(at)gmail(dot)com>
Subject: Re: Add tracking of backend memory allocated to pg_stat_activity
Date: 2022-11-27 15:17:34
Message-ID: CALte62zc20PuSc=iCg+2-+-3Bh6k4xPXVUZZCuF5mpfh5SjSMg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Nov 26, 2022 at 9:32 PM Reid Thompson <reid(dot)thompson(at)crunchydata(dot)com>
wrote:

> On Sat, 2022-11-26 at 22:10 -0500, Reid Thompson wrote:
> > Code rebased to current master.
> > Updated to incorporate additional recommendations from the the list
> > - add units to variables in view
> > - remove 'backend_' prefix from variables/functions
> > - update documentation
> > - add functional test for allocated_bytes
> > - refactor allocation reporting to reduce number of functions and
> > branches/reduce performance hit
> > - zero allocated bytes after fork to avoid double counting
> > postmaster allocations
> >
> >
> >
> >
>
> attempt to remedy cfbot windows build issues
>
>
> Hi,

+ if (request_size > *mapped_size)
+ {
+ pgstat_report_allocated_bytes(*mapped_size,
DECREASE);
+ pgstat_report_allocated_bytes(request_size,
INCREASE);

pgstat_report_allocated_bytes is called twice for this case. Can the two
calls be combined into one (with request_size - *mapped_size, INCREASE) ?

Cheers

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2022-11-27 15:40:53 Re: Add tracking of backend memory allocated to pg_stat_activity
Previous Message Justin Pryzby 2022-11-27 14:47:26 Re: Documentation for building with meson