Re: memory leak in libxml2 - fix

Поиск
Список
Период
Сортировка
Искать
От
Pavel Stehule
Тема
Re: memory leak in libxml2 - fix
Дата
Msg-id
AANLkTimQM0=R17fOzh3REPxp+c=ura41mE65aLkS-Er+@mail.gmail.com
Ответ на
Список
Дерево обсуждения
memory leak in libxml2 - fix Pavel Stehule <pavel.stehule@gmail.com>
Re: memory leak in libxml2 - fix Itagaki Takahiro <itagaki.takahiro@gmail.com>
Re: memory leak in libxml2 - fix Pavel Stehule <pavel.stehule@gmail.com>
Re: memory leak in libxml2 - fix Tom Lane <tgl@sss.pgh.pa.us>
Re: memory leak in libxml2 - fix Alvaro Herrera <alvherre@commandprompt.com>
Re: memory leak in libxml2 - fix Tom Lane <tgl@sss.pgh.pa.us>
Re: memory leak in libxml2 - fix Pavel Stehule <pavel.stehule@gmail.com>
2010/11/26 Itagaki Takahiro :
> On Fri, Nov 26, 2010 at 17:59, Pavel Stehule  wrote:
>> our customer showed a very significant memory leak in xml2.
>> It never release a memory allocated for context and doctree.
>
> Why did you change doctree and ctxt to global variables?
> I'm not sure why /* xmlFreeDoc(doctree); */ is commented out
> at the end of pgxml_xpath(), but is it enough to enable the code?
>

I am thinking, so you must not to call xmlFreeDoc(doctree) early.
Probably xmlXPathCastToXXX reading a doctree.

xmlXPathFreeContext(ctxt); xmlFreeDoc(doctree); are called now only
when function doesn't return a value.

Regards

Pavel Stehule


> --
> Itagaki Takahiro
>

В списке pgsql-hackers по дате отправления
От: Pavel Stehule
Дата:
От: Dimitri Fontaine
Дата:
FAQ