Re: Memory leak in vac_update_relstats ?

Поиск
Список
Период
Сортировка
От NikhilS
Тема Re: Memory leak in vac_update_relstats ?
Дата
Msg-id d3c4af540707200317n25b26ef1if3e364680dcd60b4@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Memory leak in vac_update_relstats ?  (Heikki Linnakangas <heikki@enterprisedb.com>)
Ответы Re: Memory leak in vac_update_relstats ?
Список pgsql-hackers
Hi,

It's palloc'd in the current memory context, so it's not serious. It'll
be freed at the end of the transaction, if not before that. That's the
beauty of memory contexts; no need to worry about small allocations like
that.

That's the beauty of memory contexts for small allocations. But because of the 'convenience' of memory contexts we sometimes tend to not pay attention to doing explicit pfrees. As a general rule I think allocations in TopMemoryContext should be critically examined. I was bitten by this undue bloat recently while developing some code and valgrind is not of much help in such cases because of this very beauty of memory contexts :).

Regards,
Nikhils

--
EnterpriseDB               http://www.enterprisedb.com

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Memory leak in vac_update_relstats ?
Следующее
От: NikhilS
Дата:
Сообщение: Re: Memory leak in vac_update_relstats ?