Memory mess introduced by recent funcapi.c patch

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Memory mess introduced by recent funcapi.c patch
Дата
Msg-id 27153.1227743054@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
This patch:
http://archives.postgresql.org/pgsql-committers/2008-02/msg00356.php
which was alleged to prevent memory leaks, seems to have introduced
some.  The problem is that shutdown_MultiFuncCall() now performs aMemoryContextSwitchTo(flinfo->fn_mcxt);
which means that an exiting SRF will now leave CurrentMemoryContext
pointing at a long-lived context, not the short-lived context in which
the function was called.  Subsequent operations that think they are
running in a short-lived context (and hence can be cavalier about
whether to free allocations) now result in memory leaks.

Did you have a specific reason for adding that?  There was no trace
of any such switch before, and a quick check with the regression
tests shows no harm from taking it out.  Plus that makes the memory
leak I'm seeing go away ...

For the record, the test case that led me to this wasselect unnest((ts_debug(title)).lexemes) as lex from
publications_test;
where publications_test.title is a long column of article titles,
and I wanted to extract a single column of lexemes.
        regards, tom lane


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

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: What's going on with pgfoundry?
Следующее
От: "David Rowley"
Дата:
Сообщение: Re: Windowing Function Patch Review -> Standard Conformance