[xsd-users] Tree streaming serialization

Pavel Fiala pavel.fiala at cern.ch
Fri Feb 7 12:05:04 EST 2014


Hello,

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.

I'm using xsd 3.3.0 and XercesC 3.1.1 on 64bit linux distribution. It 
seems that the problem is how DOMElements are created as they are 
probably not released. The same behaviour is when I try to call 
DOMElement::release() in serializer::next() just after serializing each 
element.

Any idea how to fix the memory usage and release each element after 
serializing it? I have a problem with my own schema and XML 
serialization as it takes up to 2 GB of memory. Parsing using the 
streaming example works fine with only ~5 MB of memory.

Cheers,
Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: position-50000.png
Type: image/png
Size: 38566 bytes
Desc: not available
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20140207/0be3ee6c/position-50000-0001.png


More information about the xsd-users mailing list