Re: Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Jan Urbański <wulczer@wulczer.org>
Cc: Stephen Frost <sfrost@snowman.net>, Tom Lane <tgl@sss.pgh.pa.us>, David Fetter <david@fetter.org>, PG Hackers <pgsql-hackers@postgresql.org>
Date: 2011-03-31T05:35:08Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix plpgsql to release SPI plans when a function or DO block is freed.
- 87f2ad1326bf 9.1.0 cited
Attachments
- plpython-leak-2.diff (text/x-diff) patch
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