Re: [GENERAL] Memory Errors... - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] Memory Errors...
Date
Msg-id 26631.1032452336@sss.pgh.pa.us
Whole thread Raw
Responses Re: [GENERAL] Memory Errors...
Re: [GENERAL] Memory Errors...
List pgsql-hackers
"Ian Harding" <ianh@tpchd.org> writes:
> It is pltcl [not plpgsql]

Ah.  I don't think we've done much of any work on plugging leaks in
pltcl :-(.

> It hurts when I do this:

> drop function memleak();
> create function memleak() returns int as '
> for {set counter 1} {$counter < 100000} {incr counter} {
>         set sql "select ''foo''"
>         spi_exec "$sql"
> }
> ' language 'pltcl';
> select memleak();

Yeah, I see very quick memory exhaustion also :-(.  Looks like the
spi_exec call is the culprit, but I'm not sure exactly why ...
anyone have time to look at this?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] killing process question
Next
From: Tom Lane
Date:
Subject: Re: Proposal for resolving casting issues