Re: BUG #1755: SPI_execute_plan not releasing memory even after SPI_finish - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #1755: SPI_execute_plan not releasing memory even after SPI_finish
Date
Msg-id 23851.1120582196@sss.pgh.pa.us
Whole thread Raw
In response to BUG #1755: SPI_execute_plan not releasing memory even after SPI_finish  ("Tzahi Fadida" <tzahi_ml@myrealbox.com>)
List pgsql-bugs
"Tzahi Fadida" <tzahi_ml@myrealbox.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

pgsql-bugs by date:

Previous
From: "Tzahi Fadida"
Date:
Subject: BUG #1755: SPI_execute_plan not releasing memory even after SPI_finish
Next
From: Thanh Q Lam
Date:
Subject: Error installing Postgres on Solaris 9