Re: memory leak in libxml2 - fix

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: memory leak in libxml2 - fix
Дата
Msg-id AANLkTinG2Z+giEnO2Kwm_zJobyaqDA_FPHSeqvAhhDNv@mail.gmail.com
обсуждение исходный текст
Ответ на Re: memory leak in libxml2 - fix  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
2010/11/26 Tom Lane <tgl@sss.pgh.pa.us>:
> Pavel Stehule <pavel.stehule@gmail.com> writes:
>> 2010/11/26 Itagaki Takahiro <itagaki.takahiro@gmail.com>:
>>> 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.
>
> Those static variables are really ugly, and what's more this patch only
> stops some of the leakage.  Per experimentation, the result object from
> pgxml_xpath has to be freed too, once it's been safely converted to
> whatever the end result type is.  You can see this by watching
>
> select sum(xpath_number('<data>' || generate_series || '</data>','/data')) from
> generate_series(1,500000);
>
> which still shows leakage with the submitted patch.  I cleaned it up
> as per attached, which doesn't show any leakage.

great

thank you very much

regards

Pavel Stehule
>
>                        regards, tom lane
>
>


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: improving foreign key locks
Следующее
От: Dmitriy Igrishin
Дата:
Сообщение: Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running