From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Fix query-lifespan memory leakage in repeatedly executed hash jo |
Date: | 2018-03-16 20:04:12 |
Message-ID: | E1ewvaG-0006zy-DZ@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix query-lifespan memory leakage in repeatedly executed hash joins.
ExecHashTableCreate allocated some memory that wasn't freed by
ExecHashTableDestroy, specifically the per-hash-key function information.
That's not a huge amount of data, but if one runs a query that repeats
a hash join enough times, it builds up. Fix by arranging for the data
in question to be kept in the hashtable's hashCxt instead of leaving it
"loose" in the query-lifespan executor context. (This ensures that we'll
also clean up anything that the hash functions allocate in fn_mcxt.)
Per report from Amit Khandekar. It's been like this forever, so back-patch
to all supported branches.
Discussion: https://postgr.es/m/CAJ3gD9cFofAWGvcxLOxDHC=B0hjtW8yGmUsF2hdGh97CM38=7g@mail.gmail.com
Branch
------
REL9_6_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/5149dc93467465e38645a5c318d7d90d806b5e53
Modified Files
--------------
src/backend/executor/nodeHash.c | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2018-03-17 06:33:45 | pgsql: Add 'unit' parameter to ExplainProperty{Integer,Float}. |
Previous Message | Tom Lane | 2018-03-16 17:44:54 | pgsql: Doc: explicitly point out that enum values can't be dropped. |