Re: [HACKERS] Memory leakage associated with plperl spi_prepare/spi_freeplan

2013-03-01 Thread Tom Lane
Alex Hunsaker bada...@gmail.com writes: On Tue, Feb 26, 2013 at 3:56 PM, Tom Lane t...@sss.pgh.pa.us wrote: I'm inclined to think the right fix is to make a small memory context for each prepared plan made by plperl_spi_prepare(). The qdesc for it could be made right in the context (getting

Re: [HACKERS] Memory leakage associated with plperl spi_prepare/spi_freeplan

2013-03-01 Thread Alex Hunsaker
On Fri, Mar 1, 2013 at 7:38 PM, Tom Lane t...@sss.pgh.pa.us wrote: Alex Hunsaker bada...@gmail.com writes: Applied with some fixes. Thanks! Your version looks much better than mine. One annonce is it still leaks :-(. I fixed that, at least for the function-lifespan leakage from

Re: [HACKERS] Memory leakage associated with plperl spi_prepare/spi_freeplan

2013-02-28 Thread Alex Hunsaker
On Tue, Feb 26, 2013 at 3:56 PM, Tom Lane t...@sss.pgh.pa.us wrote: I'm inclined to think the right fix is to make a small memory context for each prepared plan made by plperl_spi_prepare(). The qdesc for it could be made right in the context (getting rid of the unchecked malloc's near the

[HACKERS] Memory leakage associated with plperl spi_prepare/spi_freeplan

2013-02-26 Thread Tom Lane
I looked into the problem described here: http://www.postgresql.org/message-id/5125087d.8090...@deriva.de The core of the problem is that plperl's plperl_spi_prepare() sets up input conversion functions for the parameters of a prepared query using perm_fmgr_info(), which allocates FmgrInfo