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

From Stephen Frost
Subject Re: Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is
Date
Msg-id 20110328152539.GR4116@tamriel.snowman.net
Whole thread Raw
In response to Re: Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is  (Jan Urbański <wulczer@wulczer.org>)
Responses Re: Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is
List pgsql-hackers
* Jan Urbański (wulczer@wulczer.org) wrote:
> On 28/03/11 04:31, Tom Lane wrote:
> >> Do the other PLs we ship need similar fixes?
> >
> > Offhand I think the other PLs leave management of prepared plans to the
> > user.  If there are any places where they cache plans behind the scenes,
> > maybe a similar fix would be appropriate.
>
> FWIW I executed
>
> do $$ plpy.execute("select 1 from pg_class") $$ language plpythonu;
>
> 10k times in a session and the backend grew a lot in memory and never
> released it. I can't offhand see where the memory went, I'll try to
> investigate in the evening.

I'm about 90% sure that they all have this problem..  I havn't had a
chance to look at how Tom fixed pl/pgsql (I didn't think it'd be easy to
do w/o coming up with a way to explicitly tell the PL to release
something) so perhaps I'm mistaken, but they all share very similar
code..
Thanks,
    Stephen

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Proposal: q-gram GIN and GiST indexes
Next
From: Tom Lane
Date:
Subject: Re: Proposal: q-gram GIN and GiST indexes