[xsd-users] Tree streaming serialization
Boris Kolpackov
boris at codesynthesis.com
Sun Feb 9 05:28:29 EST 2014
Hi Pavel,
Pavel Fiala <pavel.fiala at cern.ch> writes:
> I'm trying to use XSD/Tree streaming serialization of a large
> document but I'm facing a problem - memory consumption. It's
> possible to reproduce it with the bundled example
> "xsd/examples/cxx/tree/streaming". I've changed the number of
> generated position elements to 50000 and it takes ~9 MB of memory,
> see attached screenshot.
What happens if you try to serialize, say, 1M of position elements
(maybe send them to /dev/null)? The 9MB is not really large enough
to indicate constantly increaing memory consumption (it could just
be cached; see below).
> It seems that the problem is how DOMElements are created as they are
> probably not released.
What happens with elements is they are returned to the document's
cache and then (potentially) reused.
BTW, for the next release of XSD we have improved and generalized
streaming parser and serializer significantly. In particular, you
no longer need to modify them for your XML vocabulary. They are
completely generic and can do streaming parsing/serialization
any number of levels deep. Let me know if you would like the
updated 'streaming' example.
Boris
More information about the xsd-users
mailing list