Re: BUG #4677: memory growth

From: aiwaniuk(at)instytut(dot)com(dot)pl
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4677: memory growth
Date: 2009-02-27 11:00:18
Message-ID: 20090227110018.GA13356@troy.imm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Feb 26, 2009 at 03:50:16PM -0500, Tom Lane wrote:
> "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
> 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.

thanks for replay.

i have to say something more. i see that if there is one perform
of f() (no matter if it is begin - exception block, or not) postgres
process consumes 450MB of memory. but if there are two executions of
f(), and i make
select info.memory_growth(1000000);
postgres process consumes 5.2GB of memory. this is way too much...
or not ? isn't it some bug in memory reciment ?

executing f() only once, consumes as i mention, 450MB of
memory. changing number of loops in execution do not lead to memory
growth. if we performing two executions of f() (one in begin -
exception block) used memory is growing, on and on. i have 13GB of
memory, and multiplying number loops by 10 (from 1000000 to 10000000)
causes server crash - not enough memory.

there is one interesting thing, if i create a copy of f() function (lets say
f1), and function f() is performing in begin-exception block, and f1()
is performing in main block, mamory do not grows!! postgres constantly
uses 450MB interesting, isn't it ?

looking forward for comment

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message aiwaniuk 2009-02-27 11:33:43 Re: BUG #4677: memory growth
Previous Message Dave Page 2009-02-27 10:57:25 Re: BUG #4635: postgres.exe crash when RAISE NOTICE during debugging of PL/pgSQL function in PgAdminIII