[xsd-users] XSD uses a lot of memory
Boris Kolpackov
boris at codesynthesis.com
Tue Mar 3 06:12:51 EST 2015
Hi Maxim,
Maxim Maslennikov <maxim.maslennikov at gmail.com> writes:
> I created a program of xml data binding test.xsd schema from example
> folder based on xsd C++/tree and libstudxml persistence. I tested xsd
> on OS X and FreeBSD and was surprised xsd version uses in ten time
> more memory than libstudxml version.
>
> Why does xsd/c++ tree uses memory more?
Because C++/Tree is an in-memory mapping. It loads all the data from
the XML document into memory. In contrast, libstudxml is a streaming
parser, it only keeps a very small portion of the document at any
given time (unless you store this data yourself somewhere).
> Is it possible to improve it?
Yes, you can use streaming parser with C++/Tree. See the 'streaming'
example.
Boris
More information about the xsd-users
mailing list