Re: Probable memory leak with ECPG and AIX

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: Probable memory leak with ECPG and AIX
Дата
Msg-id CAECtzeXE0vfvrUHwDJ56rgMD6axDH7n5K2vyfLTcU4vkUK4yaQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Probable memory leak with ECPG and AIX  (Noah Misch <noah@leadboat.com>)
Ответы Re: Probable memory leak with ECPG and AIX
Список pgsql-hackers
Le dim. 2 janv. 2022 à 01:07, Noah Misch <noah@leadboat.com> a écrit :
On Sat, Jan 01, 2022 at 11:35:02AM -0500, Tom Lane wrote:
> Noah Misch <noah@leadboat.com> writes:
> > I get the same results.  The leak arises because AIX freelocale() doesn't free
> > all memory allocated in newlocale().  The following program uses trivial
> > memory on GNU/Linux, but it leaks like you're seeing on AIX:
>
> Bleah.
>
> > If you have access to file an AIX bug, I recommend doing so.  If we want
> > PostgreSQL to work around this, one idea is to have ECPG do this newlocale()
> > less often.  For example, do it once per process or once per connection
> > instead of once per ecpg_do_prologue().
>
> It's worse than that: see also ECPGget_desc().  Seems like a case
> could be made for doing something about this just on the basis
> of cycles expended, never mind freelocale() bugs.

Agreed.  Once per process seems best.  I only hesitated before since it means
nothing will free this storage, which could be annoying in the context of
Valgrind and similar.  However, ECPG already has bits of never-freed memory in
the form of pthread_key_create() calls having no pthread_key_delete(), so I
don't mind adding a bit more.

Did this get anywhere? Is there something we could do to make this move forward?


--
Guillaume.

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

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: Summary Sort workers Stats in EXPLAIN ANALYZE
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: turn fastgetattr and heap_getattr to inline functions