Re: psql leaks memory on query cancellation

Поиск
Список
Период
Сортировка
От Darafei "Komяpa" Praliaskouski
Тема Re: psql leaks memory on query cancellation
Дата
Msg-id CAC8Q8t+Hb4pjb0QG6vJT7wNNz1-2QuZ-VZ=Tv8vZ7j1pZAoCrw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: psql leaks memory on query cancellation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Therefore, I propose the attached patch, which simply sees to it that
we discard any partial query result at the start of error message
collection not the end.  This makes the behavior very much better,
at least on Linux.

I have tested the build of Postgres with attached patch and confirm that I don't see this problematic behavior anymore even with default allocator. Thank you!

I think this is a back-patchable bug fix; certainly so at least back
to 9.6 where \errverbose was added.  Versions before that do not show
the persistent memory bloat the OP is complaining of, so that what
we have here is arguably a performance regression.  Comments?

This should not bring regression, since the memory is freed anyway, but is valuable as puts less pressure on client memory requirements for manual data inspection workflows.

Darafei Praliaskouski, 
GIS Engineer / Juno Minsk

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: minor fix for acquire_inherited_sample_rows
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Is a modern build system acceptable for older platforms