Re: Add tracking of backend memory allocated to pg_stat_activity - Mailing list pgsql-hackers

From Reid Thompson
Subject Re: Add tracking of backend memory allocated to pg_stat_activity
Date
Msg-id cbe20863f2d24ddede079042291f672123446f16.camel@crunchydata.com
Whole thread Raw
In response to Re: Add tracking of backend memory allocated to pg_stat_activity  (Andres Freund <andres@anarazel.de>)
Responses Re: Add tracking of backend memory allocated to pg_stat_activity  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Fri, 2022-12-02 at 09:18 -0800, Andres Freund wrote:
> Hi,
>
> On 2022-12-02 11:09:30 -0500, Reid Thompson wrote:
> > It appears to me that Postmaster populates the local variable that
> > *my_allocated_bytes points to. That allocation is passed to forked
> > children, and if not zeroed out, will be double counted as part of
> > the child allocation. Is this invalid?
>
> I don't think we should count allocations made before
> backend_status.c has
> been initialized.
>
> Greetings,
>
> Andres Freund

Hi,
The intent was to capture and display all the memory allocated to the
backends, for admins/users/max_total_backend_memory/others to utilize.
Why should we ignore the allocations prior to backend_status.c?

Thanks,
Reid

--
Reid Thompson
Senior Software Engineer
Crunchy Data, Inc.

reid.thompson@crunchydata.com
www.crunchydata.com



pgsql-hackers by date:

Previous
From: Pavel Borisov
Date:
Subject: Re: [PATCH] Check snapshot argument of index_beginscan and family
Next
From: Masahiko Sawada
Date:
Subject: Re: Force streaming every change in logical decoding