SPI memory managment issue

Started by Nonameabout 22 years ago2 messagesgeneral
Jump to latest
#1Noname
bsimon@loxane.com

I've read in the doc that every memory allocation done in a spi memory
context was freed at the end of the context (after spi_finish)
What happens if the context is is initialized inside another one ?

Here is my function :

spi_connect()

execute query1;
...
execute query10;

spi_finish()

The thing is that I do another spi_connect inside all subqueries (query1
... query10) and the memory allocated inside all "subcontext" doesn't
seems to be freed until the last call of spi_finish. (the one of the
"big" function).

Hopefully I was clear enough :)
Any help ?

Benjamin.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Noname (#1)
Re: SPI memory managment issue

bsimon@loxane.com writes:

The thing is that I do another spi_connect inside all subqueries (query1
... query10) and the memory allocated inside all "subcontext" doesn't
seems to be freed until the last call of spi_finish. (the one of the
"big" function).

No, spi_finish frees memory used in that particular SPI invocation.
What's your evidence for thinking otherwise?

regards, tom lane