Re: [xml] =?iso-8859-1?q?=BFleak_using_libxml2_for_sax-parsing_html_i?= =?iso-8859-1?q?n_python=3F?=



On Fri, Jan 05, 2007 at 04:06:57PM +0100, Cesar Ortiz wrote:
Hi all,

I am using libxml2 for parsing html in python. I was thinking that libxml2
could be involved, so I modified one of the website python examples in order
to process a revelant number of html files while I checked the memory
comsuption with the top command.

  Which is just a very wrong way to try to assert memory leak.

And... yes! the program does increase the memory consumption till it finish.

  Can be perfectly normal to some point.

libxml2.cleanupParser()
if libxml2.debugMemory(1) == 0:
   print "OK"
else:
   print "Memory leak %d bytes" % (libxml2.debugMemory(1))
   libxml2.dumpMemory()

Libxml2 wise that's the only serious way to check for leaks, check that output.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]