Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group