Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-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: plpython-leak-2.diff
Description: text/x-diff (1.4 KB)

In response to

Responses

pgsql-hackers by date

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

pgsql-committers by date

Next:From: Heikki LinnakangasDate: 2011-03-31 07:10:50
Subject: pgsql: Improve error message when WAL ends before reaching end ofonlin
Previous:From: Bruce MomjianDate: 2011-03-30 21:46:21
Subject: pgsql: Mention pg_upgrade sets autovacuum_freeze_max_age to maximum.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group