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

From Reid Thompson
Subject Add tracking of backend memory allocated to pg_stat_activity
Date
Msg-id 67bb5c15c0489cb499723b0340f16e10c22485ec.camel@crunchydata.com
Whole thread Raw
Responses Re: Add tracking of backend memory allocated to pg_stat_activity
Re: Add tracking of backend memory allocated to pg_stat_activity
List pgsql-hackers
Hi Hackers,

Attached is a patch to
Add tracking of backend memory allocated to pg_stat_activity
   
This new field displays the current bytes of memory allocated to the
backend process.  It is updated as memory for the process is
malloc'd/free'd. Memory allocated to items on the freelist is included
in the displayed value.  Dynamic shared memory allocations are included
only in the value displayed for the backend that created them, they are
not included in the value for backends that are attached to them to
avoid double counting. On occasion, orphaned memory segments may be
cleaned up on postmaster startup. This may result in decreasing the sum
without a prior increment. We limit the floor of backend_mem_allocated
to zero.


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

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

Attachment

pgsql-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: Tracking last scan time
Next
From: Tom Lane
Date:
Subject: Re: SQL/JSON features for v15