[XML-SIG] PyXML API problem

Kamel Hamard (LMC) kamel.hamard at ericsson.com
Wed Jul 16 09:50:07 EDT 2003


Hi Guys,

Thanks for your anwers.

I'm doing a small test, one with PyXML API and another with 4Suite.

In the test with PyXML I'm able to stabilise the memory growth but with the one with 4Suite I'm not able to do it and the GC is not collecting the memory. Here the python example in which I'm creating a dom, in the top unix command, you can see the memory growing.

I'll be happy if there is a good explaination to this behaviour.

4suite.py use 4Suite API
pyxml.py uses PyXML API

Thanks

Kamel

-----Original Message-----
From: martin at v.loewis.de [mailto:martin at v.loewis.de]
Sent: Wednesday, July 16, 2003 12:49 AM
To: Jeremy Kloth
Cc: Kamel Hamard (QC/LMC); 'Fred L. Drake, Jr.'; xml-sig at python.org
Subject: Re: [XML-SIG] PyXML API problem


"Jeremy Kloth" <jeremy.kloth at fourthought.com> writes:

> I forget to mention one other thing.  By using gc.collect() you are simply
> telling Python to run the collection cycle, which is something that it does
> itself at some interval.

Interestingly enough, for XML DOM, the collection frequency might be
too low. Python invokes collection every 700 (used to be 1000)
allocations of container objects. If you have documents with little
structure and large CDATA, the string objects (which are not accounted
for in cyclic thresholds) could consume a lot of memory.

So if invoking gc.collect explicitly helps, you might just as well
invoke gc.set_threshold, to invoke automatic collection more
frequently.

HTH,
Martin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4suite.py
Type: application/octet-stream
Size: 3954 bytes
Desc: not available
Url : http://mail.python.org/pipermail/xml-sig/attachments/20030716/4ba07c0a/4suite.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pyxml.py
Type: application/octet-stream
Size: 1801 bytes
Desc: not available
Url : http://mail.python.org/pipermail/xml-sig/attachments/20030716/4ba07c0a/pyxml.obj


More information about the XML-SIG mailing list