Re: BUG #4677: memory growth

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "aiwaniuk" <aiwaniuk(at)instytut(dot)com(dot)pl>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4677: memory growth
Date: 2009-02-26 20:50:16
Message-ID: 6168.1235681416@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"aiwaniuk" <aiwaniuk(at)instytut(dot)com(dot)pl> writes:
> i postgres version 8.2, 8.3 and probobly 8.1 there is problem with running
> VOLATILE plpgsql function with begin - exception checking that performs
> other VOLATILE plpgsql function. if either, first or second performing
> removed, problem doesn't shows. here's an example

The reason there's an issue here is that you're invoking the same
function f() both inside and outside the subtransactions caused by
the begin/exception block. The expressions inside f() get re-prepared
each time the subtransaction ID changes. The memory this eats is
reclaimed at subtransaction end. So the memory used by the call inside
the begin/exception block is cleaned up immediately, but the memory
used by the other call accumulates in the outer subtransaction's
workspace.

We'll think about how to fix this, but you shouldn't expect that a
fix will appear quickly. A possible workaround is to put another
begin/exception block around the other call of the function.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael.L.Blume 2009-02-26 21:28:07 Database/Table Owner Question
Previous Message Manuel G Vazquez B/Mexico/IBM 2009-02-26 19:58:56 Support platform of PostgresSQL 8.1.9 under IBM AIX 5.3