Fabien COELHO <coe...@cri.ensmp.fr> writes: > I notice that buf.data is not freed. I guess that the server memory > management will recover it.
Yeah, it's in the transient context holding all of the results of reading the file. I considered pfree'ing it at the end of the function, but I concluded there's no point. The space will be recycled when the context is destroyed, and since we're not (IIRC) going to allocate anything more in that context, nothing would be gained by freeing it earlier --- it'd just stay as unused memory within the context. regards, tom lane