[xsde-users] serialisation with periodical controlled flushing of buffers

Alex Gubashin alex.gubashin at gmail.com
Fri Nov 9 07:04:33 EST 2012


Hi Boris,

On Nov 9, 2012, at 3:30 PM, Boris Kolpackov <boris at codesynthesis.com> wrote:

> Hi Alex,
> 
> Alex Gubashin <alex.gubashin at gmail.com> writes:
> 
>> I'm using XSD/e for iPhone project and i have some memory allocation
>> issues while  serialising object to xml using hybrid model. It seems
>> like serialisation part of the code consumes a way too much memory,
>> even for small xml models. Is there any way to periodically force
>> serializer to flush data from buffer to file?
> 
> XSD/e doesn't really do any buffering during serialization. Once data
> is ready, it is written.
> 
> I assume you use std::ostream to save the data to a file or similar.
> std::ofstream, for example, does some buffering. This page discuss
> how you can control it:
> 
> http://stackoverflow.com/questions/351582/how-can-i-discover-control-the-level-of-internal-buffering-in-a-c-fstream
> 
> Finally, XSD/e provides a low-level writer interface that you can use
> instead of std::ostream. This way you will be called every time some
> data is available to be written. For more information, see Section 8.1,
> "Document Serializer" in the C++/Serializer Getting Started Guide:
> 
> Boris


Thanks for the answer.

Best regards,
Alex Gubashin



More information about the xsde-users mailing list