From: Jeff Davis <jdavis@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Specialize MemoryContextMemAllocated().
Date: Wed, 18 Mar 2020 22:39:28 +0000
Message-ID: <E1jEhLU-0002Jd-6G@gemulon.postgresql.org> (raw)
Specialize MemoryContextMemAllocated().
An AllocSet doubles the size of allocated blocks (up to maxBlockSize),
which means that the current block can represent half of the total
allocated space for the memory context. But the free space in the
current block may never have been touched, so don't count the
untouched memory as allocated for the purposes of
MemoryContextMemAllocated().
Discussion: https://postgr.es/m/ec63d70b668818255486a83ffadc3aec492c1f57.camel@j-davis.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/e00912e11a9ec2d29274ed8a6465e81385906dc2
Modified Files
--------------
src/backend/utils/mmgr/aset.c | 46 ++++++++++++++++++++++++++-----------
src/backend/utils/mmgr/generation.c | 25 ++++++++++++++++----
src/backend/utils/mmgr/mcxt.c | 3 +--
src/backend/utils/mmgr/slab.c | 29 +++++++++++++++++------
src/include/nodes/memnodes.h | 2 +-
5 files changed, 77 insertions(+), 28 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: jdavis@postgresql.org
Subject: Re: pgsql: Specialize MemoryContextMemAllocated().
In-Reply-To: <E1jEhLU-0002Jd-6G@gemulon.postgresql.org>
References: <E1jEhLU-0002Jd-6G@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox