minidom memory performance

"Martin v. Löwis" martin at v.loewis.de
Fri May 23 18:04:25 EDT 2003


Geoff Gerrietts wrote:
> that when I load my own 26kB XML file into a
> minidom tree, my process size grows a little more than 2MB.
> 
> By my very rough calculations, that's in the neighborhood of 10000%
> memory consumption. Is there
> something else that's going on there that I don't understand?

Most likely, although it is not clear what that is. If you want to
understand this better, you should
- find out how much of these 2MB are constant overhead for
   the minidom implementation. I.e. if you add another 26kB,
   does it grow another 2MB?
- find out how much the overhead depends on the number of nodes.
   Count the number of nodes, and produce another XML document
   with a single node and all text, and compare memory consumption.
- find out how much the overhead depends on the number of attributes.
   Likewise.

If you have more detailed number (how many instances of what types, how 
many attributes per instead), we can find out in more detail where
the memory consumption comes from.

Regards,
Martin





More information about the Python-list mailing list