Memory leak
alex116321 at my-deja.com
alex116321 at my-deja.com
Tue Jan 2 14:00:48 EST 2001
I am experiencing memory leakage when using Python and COM.
Specifically, I am using the Micosoft XML Parser to load and traverse
XML DOM stuctures. Everytime I access an XML node, more memory is
consumed. After a while, this can eat away most of the system
resources if the Python session is not terminated. Here is a simple
example (assume the interpreter is used as a server and does not exit):
############################################
#Note: using del doesn't seem to help
############################################
import win32com.client
o = win32com.client.Dispatch("microsoft.xmldom")
o.loadXML("<test/>")
for idx in range(50000):
node = o.selectSingleNode("//test")
#############################################
Any suggestions would be appreciated.
Sent via Deja.com
http://www.deja.com/
More information about the Python-list
mailing list