Re: [HACKERS] memory leak in libxml2 - fix

2010-11-26 Thread Pavel Stehule
2010/11/26 Tom Lane : > Pavel Stehule writes: >> 2010/11/26 Itagaki Takahiro : >>> 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

Re: [HACKERS] memory leak in libxml2 - fix

2010-11-26 Thread Tom Lane
Alvaro Herrera writes: > This looks great. As this fixes a problem that was reported to us two > days ago, I'm interested in backpatching it. Are you going to do it? Yeah, I'm on it. It's a bit tedious because the back branches are different ... regards, tom lane --

Re: [HACKERS] memory leak in libxml2 - fix

2010-11-26 Thread Alvaro Herrera
Excerpts from Tom Lane's message of vie nov 26 16:14:08 -0300 2010: > 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 t

Re: [HACKERS] memory leak in libxml2 - fix

2010-11-26 Thread Tom Lane
Pavel Stehule writes: > 2010/11/26 Itagaki Takahiro : >> 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 xmlFreeDo

Re: [HACKERS] memory leak in libxml2 - fix

2010-11-26 Thread Pavel Stehule
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 /* xmlF

Re: [HACKERS] memory leak in libxml2 - fix

2010-11-26 Thread 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

[HACKERS] memory leak in libxml2 - fix

2010-11-26 Thread Pavel Stehule
Hello our customer showed a very significant memory leak in xml2. try to select xpath_number('' || generate_series || '','/data') from generate_series(1,50); attention! take all memory very fast It never release a memory allocated for context and doctree. Regards Pavel Stehule *** ./xpat