Re: Avoid memory leaks during base backups
От | Tom Lane |
---|---|
Тема | Re: Avoid memory leaks during base backups |
Дата | |
Msg-id | 3886739.1664340568@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Avoid memory leaks during base backups (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>) |
Ответы |
Re: Avoid memory leaks during base backups
|
Список | pgsql-hackers |
Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> writes: > I had the same opinion. 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. Not following your last point here? A process exiting on FATAL does not especially need to clean up its memory allocations first. Which is good, because "backup-related code doesn't have any FATALs" seems like an assertion with a very short half-life. regards, tom lane
В списке pgsql-hackers по дате отправления: