From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Matthias Otterbach <mo@otterbach.eu>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15700: PG 10 vs. 11: Large increase in memory usage when selecting BYTEA data (maybe memory leak)
Date: Mon, 18 Mar 2019 15:24:06 -0700
Message-ID: <20190318222406.nlc6372xfou4kr5o@alap3.anarazel.de> (raw)
In-Reply-To: <6061.1552946620@sss.pgh.pa.us>
References: <15700-8c408321a87d56bb@postgresql.org>
<16717.1552926811@sss.pgh.pa.us>
<4ef5f38d5710c4d5c289537c588c7335@otterbach.eu>
<CAMkU=1wW32K8n4ut_7zz+6HH1J068tFtpv5os=eeAgvjiQH8ZQ@mail.gmail.com>
<CAMkU=1x_XySqXZ-1gCyoaipKLzefQSr1BuaHL12vy_9WKFnjYQ@mail.gmail.com>
<13467.1552942521@sss.pgh.pa.us>
<20190318215710.f6balpny456kink2@alap3.anarazel.de>
<6061.1552946620@sss.pgh.pa.us>
Hi,
On 2019-03-18 18:03:40 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > We're also assuming that we don't leak into MessageContext over such
> > cycles, which seems wrong. At the very least things like
> > errdetail_params() are happy to leak into MessageContext.
>
> This leak isn't in MessageContext; if it were, there likely wouldn't
> have been a noticeable problem.
I know that this leak wasn't into MessageContext - I was (wrongly)
thinking that there also might be an issue related to MessageContext
too, but I was wrong on that.
> It's leaking in the executor's
> context over repeat ExecutorRun cycles in the same execution state.
What I don't quite get is why we're doing
if (sendTuples)
dest->rStartup(dest, operation, queryDesc->tupDesc);
inside the per-query context, given that the lifetime of the started
dest receiver can be, like in this example, be considerably shorter than
the query execution. I guess given the current interface we can't
really do much better, as we'd also not want to leak into the calling
context, and allocating yet another memory context wouldn't be cheap :(
Greetings,
Andres Freund
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: pgsql-bugs@postgresql.org
Cc: andres@anarazel.de, tgl@sss.pgh.pa.us, jeff.janes@gmail.com, mo@otterbach.eu, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15700: PG 10 vs. 11: Large increase in memory usage when selecting BYTEA data (maybe memory leak)
In-Reply-To: <20190318222406.nlc6372xfou4kr5o@alap3.anarazel.de>
* 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