[Expat-discuss] expat Memory Footprint?

Steve Vernon stevencvernon at comcast.net
Sun Apr 29 07:09:48 CEST 2007


What is the memory footprint for expat?  How does it grow with the input document?

I would like to know what is the starting size, then what "variables" it depends upon and what is the factor of expansion for each such variable.  (Of course, I am talking about non-static data size - compiled code size is not likely to be an issue.)

For example, I assume that for parsing that we need to at minimum keep track of all the open start tags (ones that so far have seen no corresponding end tags) and that these are stored in XML_Chars.  But perhaps there is other overhead per open start tag.  And, of course, there could be information stored for DTD items.

The best estimate of the size would be appreciated.  At most a factor of 2 over the reality.  It seems that XML_MIN_SIZE affects some size, but am not certain that it affects data size - again, we won't likely have issues with code size.  We will likely want to use most features of expat, so we don't want to turn off features.

We have a constrained memory environment and will need to do many parallel parses.  With enough parallelism the total memory footprint could get prohibitive if expat is not frugal.  Essentially every byte may count.

Thanks in advance.


More information about the Expat-discuss mailing list