Re: Can SET_VARSIZE cause a memory leak? - Mailing list pgsql-general

From Michael Paquier
Subject Re: Can SET_VARSIZE cause a memory leak?
Date
Msg-id CAB7nPqTvn+zubS4uVRajUBnPO2O9auYK91_BrhF1_Ns6HA-cGQ@mail.gmail.com
Whole thread Raw
In response to Re: Can SET_VARSIZE cause a memory leak?  (Albe Laurenz <laurenz.albe@wien.gv.at>)
List pgsql-general
On Wed, Jun 8, 2016 at 9:55 PM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
> This is safe, and the memory will be freed at the end of the transaction.

Yes, palloc takes memory from the current memory context. The case
where you would need to use pfree is if there is an allocation
continuously done within the same code paths for a reason or another
that may result in a leak if this code path is taken repeatedly and
that the memory used is wasted out.
--
Michael


pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Unregistered OpenSSL callbacks access violation
Next
From: Patrick B
Date:
Subject: Re: Automate copy - Postgres 9.2