help with xml.dom.minidom memory leak
Victor Muslin
victor at prodigy.net
Thu May 24 13:43:49 EDT 2001
ActiveStates Python 2.1 build 210 for Win32 seems to have stopped the
leak :-)
Also it is illegal to unlink the document node after the dom is
unlinked, which, I believe, is the documented behavior. Python 2.0
implementaiton allowed to do it (which is why I had tried it in
desperation :-) ).
Thank you, Martin.
On 24 May 2001 17:32:24 +0200, Martin von Loewis
<loewis at informatik.hu-berlin.de> wrote:
>victor at prodigy.net (Victor Muslin) writes:
>
>> Below is a short program that leaks memory. Any ideas how to plug the
>> leak? What am I doing wrong?
>
>What python version? With your exact code, I get a traceback
>
> File "/usr/local/lib/python1.5/site-packages/xml/dom/minidom.py", line 441, in unlink
> for attr in self._attrs.values():
>
>since, after unlinking the document, unlinking the DOM fails.
>
>With Python 2.1 and PyXML 0.6.5, on Solaris 8, I cannot reproduce the
>memory leak, nor can I reproduce it with plain Python 2.1 (i.e. no
>PyXML).
>
>In Python 2.0, there was a bug where pyexpat objects where not
>properly deallocated after parsing, and would not be found by the
>garbage collector either.
>
>I recommend either installing PyXML, or updating to Python 2.1.
>
>Regards,
>Martin
More information about the Python-list
mailing list