Re: plpython memory leak uppon empty resultsets in all versions

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: plpython memory leak uppon empty resultsets in all versions
Date: 2010-05-01 18:00:34
Message-ID: 201005012000.35017.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On Saturday 01 May 2010 19:08:40 Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> 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 your patch.
> What seems like the correct thing is to use PLy_procedure_delete(),
> as in the attached applied patch. With this, I see zero leak rate for
> either this test or the no-error-thrown variant.
Yes, I am not surprised. I havent read enough of the code to really understand
its codepaths. I didnt find it exactly obvious what happens where and when
what happens...

Thanks for really fixing the issue.

At times a sql level function that returns the current heap size would be
rather neat for writing minimal regression tests for such things would be
kinda neat. But likely it would increase the runtime a bit too much and would
be hard to implement cross-platformish...

Andres

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-05-01 18:38:19 Re: CVS build problem - make world target
Previous Message Tom Lane 2010-05-01 17:08:40 Re: plpython memory leak uppon empty resultsets in all versions