Re: [BUGS] plpython memory leak uppon empty resultsets in all versions

2010-05-03 Thread Björn Grüning
Hi! I have tested the proposed patch and it works nicely. Let me know if further testing is necessary or if i can help. Thanks! Björn Am Freitag, den 30.04.2010, 01:14 +0200 schrieb Andres Freund: > Hi all, > > plpython[u] leaks memory in PLy_spi_execute_fetch_result in the following > snippe

Re: [BUGS] plpython memory leak uppon empty resultsets in all versions

2010-05-02 Thread Andres Freund
Hi, On Saturday 01 May 2010 19:08:40 Tom Lane wrote: > Andres Freund writes: > > while true; do echo 'DO LANGUAGE plpythonu $$import > > gc;gc.collect();plpy.execute("SELECT unknown"); $$;';done|psql -h /tmp -p > > 5433 postgres > > I tried this and found there was still a leak after applying yo

Re: [BUGS] plpython memory leak uppon empty resultsets in all versions

2010-05-01 Thread Tom Lane
Andres Freund writes: > The one I measured was 9.0 only: > diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c > index 6063628..a6dd9d0 100644 > *** a/src/pl/plpython/plpython.c > --- b/src/pl/plpython/plpython.c > *** plpython_inline_handler(PG_FUNCTION_ARGS >

Re: [BUGS] plpython memory leak uppon empty resultsets in all versions

2010-04-30 Thread Andres Freund
On Friday 30 April 2010 23:54:16 Andres Freund wrote: > On Friday 30 April 2010 20:09:48 Tom Lane wrote: > > Andres Freund writes: > > > On Friday 30 April 2010 19:39:32 Tom Lane wrote: > > >> Yeah. There's a leak of the tuptable in the CATCH path, too. Will > > >> fix. > > > > > > Yes, theres

Re: [BUGS] plpython memory leak uppon empty resultsets in all versions

2010-04-30 Thread Andres Freund
On Friday 30 April 2010 20:09:48 Tom Lane wrote: > Andres Freund writes: > > On Friday 30 April 2010 19:39:32 Tom Lane wrote: > >> Yeah. There's a leak of the tuptable in the CATCH path, too. Will fix. > > > > Yes, theres even more than that (measured it) in the error case. Will > > have a look

Re: [BUGS] plpython memory leak uppon empty resultsets in all versions

2010-04-30 Thread Tom Lane
Andres Freund writes: > On Friday 30 April 2010 19:39:32 Tom Lane wrote: >> Yeah. There's a leak of the tuptable in the CATCH path, too. Will fix. > Yes, theres even more than that (measured it) in the error case. Will have a > look later today. Here's the patch I'm planning to apply --- work

Re: [BUGS] plpython memory leak uppon empty resultsets in all versions

2010-04-30 Thread Andres Freund
Hi, On Friday 30 April 2010 19:39:32 Tom Lane wrote: > Andres Freund writes: > > plpython[u] leaks memory in PLy_spi_execute_fetch_result in the following > > > snippet: > Yeah. There's a leak of the tuptable in the CATCH path, too. Will fix. Yes, theres even more than that (measured it) in th

Re: [BUGS] plpython memory leak uppon empty resultsets in all versions

2010-04-30 Thread Tom Lane
Andres Freund writes: > plpython[u] leaks memory in PLy_spi_execute_fetch_result in the following > snippet: Yeah. There's a leak of the tuptable in the CATCH path, too. Will fix. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To m

[BUGS] plpython memory leak uppon empty resultsets in all versions

2010-04-29 Thread Andres Freund
Hi all, plpython[u] leaks memory in PLy_spi_execute_fetch_result in the following snippet: Py_DECREF(result->nrows); result->nrows = PyInt_FromLong(rows); PLy_typeinfo_init(&args); oldcontext = CurrentMemoryContext; PG_TRY(); { if (rows) { Py_DECREF(result->rows