Re: ExecForceStoreMinimalTuple leaks memory like there's no tomorrow - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: ExecForceStoreMinimalTuple leaks memory like there's no tomorrow
Date
Msg-id 20190416033137.GB2673@paquier.xyz
Whole thread Raw
In response to ExecForceStoreMinimalTuple leaks memory like there's no tomorrow  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Apr 15, 2019 at 10:46:56PM -0400, Tom Lane wrote:
> create table t1 as select generate_series(1,40000000) id;
> vacuum analyze t1;
> explain select * from t1, t1 t1b where t1.id = t1b.id;
> -- should indicate a hash join
> explain analyze select * from t1, t1 t1b where t1.id = t1b.id;
>
> ... watch the process's memory consumption bloat.  (It runs for
> awhile before that starts to happen, but eventually it goes to
> a couple of GB.)
>
> It looks to me like the problem is that ExecHashJoinGetSavedTuple
> calls ExecForceStoreMinimalTuple with shouldFree = true, and
> ExecForceStoreMinimalTuple's second code branch simply ignores
> the requirement to free the supplied tuple.

Open item added, as the root comes from 4da597ed.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: ExecForceStoreMinimalTuple leaks memory like there's no tomorrow
Next
From: Michael Paquier
Date:
Subject: Re: finding changed blocks using WAL scanning