Re: [bug fix] Memory leak in dblink

From: "MauMau" <maumau307(at)gmail(dot)com>
To: "Amit Kapila" <amit(dot)kapila16(at)gmail(dot)com>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] Memory leak in dblink
Date: 2014-06-10 09:57:33
Message-ID: 7C32B1D8BD284836836C8A2D16BFC7D3@maumau
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: "Amit Kapila" <amit(dot)kapila16(at)gmail(dot)com>
> Is there a need to free memory context in PG_CATCH()?
> In error path the memory due to this temporary context will get
> freed as it will delete the transaction context and this
> temporary context will definitely be in the hierarchy of it, so
> it should also get deleted. I think such handling can be
> useful incase we use PG_CATCH() to suppress the error.

I thought the same, but I also felt that I should make an effort to release
resources as soon as possible, considering the memory context auto deletion
as a last resort. However, looking at other places where PG_CATCH() is
used, memory context is not deleted. So, I removed the modification from
PG_CATCH() block. Thanks.

Regards
MauMau

Attachment Content-Type Size
dblink_memleak_v2.patch application/octet-stream 473 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2014-06-10 10:18:28 Re: "RETURNING PRIMARY KEY" syntax extension
Previous Message Serge Negodyuck 2014-06-10 09:26:27 Re: BUG #8673: Could not open file "pg_multixact/members/xxxx" on slave during hot_standby