Re: BUG #1755: SPI_execute_plan not releasing memory even after SPI_finish

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Tzahi Fadida" <tzahi_ml(at)myrealbox(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1755: SPI_execute_plan not releasing memory even after SPI_finish
Date: 2005-07-05 16:49:56
Message-ID: 23851.1120582196@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Tzahi Fadida" <tzahi_ml(at)myrealbox(dot)com> writes:
> If you use C language SPI_execute_plan or SPI_execp it does not release its
> memory usage even after SPI_finish. Usually this is not a problem, but if
> you execute it in your function 100+ times you will feel the difference in
> the form of a memory leak.

I don't see any memory leak here.

In CVS tip, what is actually happening is that with the default setting
of temp_buffers = 1000, you can have up to 80MB worth of buffers for the
temporary table. The process expands to that size and then stops
expanding. If you set temp_buffers to 100 or so, it stops much sooner.
In 8.0.3 I don't see any "leak" at all --- the process size sits at
about 5MB for me.

It could be that 1000 is an overly large default setting for temp_buffers.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Thanh Q Lam 2005-07-05 17:22:35 Error installing Postgres on Solaris 9
Previous Message Tzahi Fadida 2005-07-05 15:32:10 BUG #1755: SPI_execute_plan not releasing memory even after SPI_finish