public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Andres Freund <[email protected]>
Cc: Fujii Masao <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Release postmaster working memory context in slotsync worker
Date: Fri, 27 Feb 2026 12:58:47 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <ukpuo66v3k5z5cpwfbofa3zwdgdb53thbxemgqvtsnf7gdf5ew@ixgj5hs4bwu6>
References: <CAHGQGwHO05JaUpgKF8FBDmPdBUJsK22axRRcgmAUc2Jyi8OK8g@mail.gmail.com>
<ukpuo66v3k5z5cpwfbofa3zwdgdb53thbxemgqvtsnf7gdf5ew@ixgj5hs4bwu6>
Andres Freund <[email protected]> writes:
> On 2026-02-28 01:25:12 +0900, Fujii Masao wrote:
>> Child processes do not need the postmaster's working memory context and
>> release it at the start of their main function. However, the slotsync worker
>> appears to have missed this step.
> Obviously this inconsistency is not good. However:
> I think we should consider *not* releasing postmaster memory. Freeing the
> memory actually can lead to an *increase* in memory usage and a slight
> *decrease* in connection startup performance. The reason for that is that with
> fork, memory allocated in postmaster is handled by copy-on-write in the
> children.
Meh. I think that's optimizing for the wrong thing. To my mind the
point of releasing that context is to be sure that child processes
don't have access to postmaster-private data. Admittedly, we're not
doing anything as drastic as zeroing out the memory, but it'll soon
be overwritten as the child starts up and populates its caches.
regards, tom lane
view thread (3+ messages) latest in thread
reply
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Release postmaster working memory context in slotsync worker
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox