| From: | Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> |
|---|---|
| To: | Michael Paquier <michael(at)paquier(dot)xyz> |
| Cc: | Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Avoid memory leaks during base backups |
| Date: | 2022-09-28 09:30:30 |
| Message-ID: | CALj2ACV+9P4TobZMNSMv1buQF_QTvT+R-XX69jtv56+kKBDbMg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, Sep 28, 2022 at 10:09 AM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> Here's what I think - for backup functions, we
> can have the new memory context child of TopMemoryContext and for
> perform_base_backup(), we can have the memory context child of
> CurrentMemoryContext. With PG_TRY()-PG_FINALLY()-PG_END_TRY(), we can
> delete those memory contexts upon ERRORs. This approach works for us
> since backup-related code doesn't have any FATALs.
>
> Thoughts?
I'm attaching the v2 patch designed as described above. Please review it.
I've added an entry in CF - https://commitfest.postgresql.org/40/3915/
--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
| Attachment | Content-Type | Size |
|---|---|---|
| v2-0001-Avoid-memory-leaks-during-backups.patch | application/x-patch | 10.4 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Kyotaro Horiguchi | 2022-09-28 09:41:10 | Re: A doubt about a newly added errdetail |
| Previous Message | Kyotaro Horiguchi | 2022-09-28 09:22:32 | Re: A doubt about a newly added errdetail |