This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients
Date 2002-04-04.07:05:14
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=21627

Also, when parsing the large xml file: if you invoke
gc.collect() after each iteration, memory consumption will
go down, and not grow over time. The reason that GC does not
trigger automatically is that you allocate all the space
through strings. GC will be invoked after 1000 new container
objects have been allocated, but you exhaust the memory
before that - so either set the GC threshold down, or invoke
GC on your own.

For the specific application, it would be sufficient if
xml.sax.__init__.parse would invoke
parser.setContentHandler(None) after parsing has completed;
this should already break the cycle.

To solve the general problem, I like your suggestion of
using a separate locator.
History
Date User Action Args
2007-08-23 14:00:09adminlinkissue535474 messages
2007-08-23 14:00:09admincreate