Re: [PATCH v1] fix potential memory leak in untransformRelOptions - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: [PATCH v1] fix potential memory leak in untransformRelOptions
Date
Msg-id 5B427D2A-F0C4-4C18-AA70-329DDA576F2A@yesql.se
Whole thread Raw
In response to [PATCH v1] fix potential memory leak in untransformRelOptions  (Junwang Zhao <zhjwpku@gmail.com>)
List pgsql-hackers
> On 1 Sep 2022, at 10:36, Junwang Zhao <zhjwpku@gmail.com> wrote:

> *TextDatumGetCString* calls palloc to alloc memory for the option
> text datum, in some cases the the memory is allocated in
> *TopTransactionContext*, this may cause memory leak for a long
> running backend.

Wouldn't that be a fairly small/contained leak in comparison to memory spent
during a long running transaction?  Do you have any example of transforming
reloptions in a loop into TopTransactionContext where it might add up?

--
Daniel Gustafsson        https://vmware.com/




pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Proposal: Allow walsenders to send WAL directly from wal_buffers to replicas
Next
From: Dave Page
Date:
Subject: Re: Tracking last scan time