Re: Memory leak in CachememoryContext

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Memory leak in CachememoryContext
Дата
Msg-id 20230424160419.44voc3w5r72uigb6@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Memory leak in CachememoryContext  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Memory leak in CachememoryContext  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2023-Apr-24, Tom Lane wrote:

> I wrote:
> > Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> >> Hmm, we can leave it unused in our code, but it still needs to be
> >> initialized to some valid memory context anyway; otherwise hypothetical
> >> code that uses it would still crash.
> 
> > I think we want that to happen, actually, because it's impossible
> > to guess what such hypothetical code needs the context to be.
> 
> I guess we could have the back branches continue to create a
> shared_cast_context and just not use it in core.  Seems rather
> expensive for a very hypothetical compatibility measure, though.

I think a session-long memory leak is not so bad, compared to a possible
crash.  However, after looking at the code again, as well as pldebugger
and plpgsql_check, I agree that there's no point in doing anything other
than keeping the field there.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"Hay dos momentos en la vida de un hombre en los que no debería
especular: cuando puede permitírselo y cuando no puede" (Mark Twain)



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

Предыдущее
От: Melanie Plageman
Дата:
Сообщение: Re: could not extend file "base/5/3501" with FileFallocate(): Interrupted system call
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Should we remove vacuum_defer_cleanup_age?