[XML-SIG] xml.dom.ext.reader.HtmlLib memory leak?

Uche Ogbuji uche.ogbuji at fourthought.com
Thu Aug 19 21:45:20 CEST 2004


On Tue, 2004-08-17 at 05:59, xmlsig at codeweld.com wrote:
> > I've python 2.3.4 on windows xp with PyXML-0.8.3.win32-py2.3
> >
> > This code leaks substancialy
> >
> > from xml.dom.ext.reader.HtmlLib import FromHtml
> > import urllib
> > from xml.dom import ext
> > s = urllib.urlopen( 'http://www.google.com' ).read()
> > while True:
> >     root = FromHtml( s )
> >     ext.ReleaseNode( root )
> >
> > However, this does not ( or only very minor )
> >
> > from xml.dom.ext.reader.Sax2 import Reader
> > import urllib
> > from xml.dom import ext
> > s = urllib.urlopen( 'http://www.infoworld.com/rss/reviews.xml' ).read()
> > while True:
> >     reader = Reader()
> >     root = reader.fromString( s )
> >     ext.ReleaseNode( root )
> >
> > Any suggestions?
> 
> Could anybody reproduce the leak?
> Any suggestions what I do wrong?

I haven't done much work in HtmlLib since it was rewritten to use
sgmlop.  It will take some heavy digging to find the precise memory
leak.  What's your overall problem?  Could you use Python 2.3's
HTMLParser library instead?


-- 
Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Decomposition, Process, Recomposition - http://www.xml.com/pub/a/2004/07/28/py-xml.html
Perspective on XML: Steady steps spell success with Google - http://www.adtmag.com/article.asp?id=9663
Managing XML libraries - http://www.adtmag.com/article.asp?id=9160
Commentary on "Objects. Encapsulation. XML?" - http://www.adtmag.com/article.asp?id=9090
Harold's Effective XML - http://www.ibm.com/developerworks/xml/library/x-think25.html
A survey of XML standards - http://www-106.ibm.com/developerworks/xml/library/x-stand4/



More information about the XML-SIG mailing list