Re: Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Jan Urbański <wulczer(at)wulczer(dot)org>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Fetter <david(at)fetter(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is
Date: 2011-03-31 05:35:08
Message-ID: 4D94128C.9050604@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 30.03.2011 21:21, Jan Urbański wrote:
> Valgrind showed me the way. PFA a trivial patch to avoid leaking a
> PLyProcedure struct in inline blocks.

Hmm, any reason the PLyProcedure struct needs to be allocated in
TopMemoryContext in the first place? Could you palloc0 it in a
shorter-lived context, or even better, just allocate it in stack?

PS. I don't think the volatile qualifier in 'proc' is in necessary. The
variable is not changed in PG_TRY-block.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
plpython-leak-2.diff text/x-diff 1.4 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-03-31 07:10:50 pgsql: Improve error message when WAL ends before reaching end of onlin
Previous Message Bruce Momjian 2011-03-30 21:46:21 pgsql: Mention pg_upgrade sets autovacuum_freeze_max_age to maximum.

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-03-31 07:20:32 Re: Replication server timeout patch
Previous Message Brendan Jurd 2011-03-31 03:39:25 Re: [HACKERS] Date conversion using day of week