Memory leak on hashed agg rescan

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Memory leak on hashed agg rescan
Дата
Msg-id b4e5ce320810151918g2acf69ebh9f80f4f2e1c203a0@mail.gmail.com
обсуждение исходный текст
Ответы Re: Memory leak on hashed agg rescan  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I noticed a minor leak in the per-query context when ExecReScanAgg()
is called for a hashed aggregate. During rescan, build_hash_table() is
called to create a new empty hash table in the aggcontext. However,
build_hash_table() also constructs the "hash_needed" column list in
the per-query context, so repeated calls of build_hash_table() result
in leaking this memory for the duration of the query.

Attached is a patch that fixes this by only constructing "hash_needed"
if it doesn't already exist. I also bms_free'd the temporary BMS that
is created, although that's pretty harmless.

Neil

Вложения

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

Предыдущее
От: ITAGAKI Takahiro
Дата:
Сообщение: Re: Annoying error messages in _dosmaperr
Следующее
От: "Robert Haas"
Дата:
Сообщение: Re: array_agg (was Re: The Axe list)