Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How much memory does XStream consume?

Consume memory xStream
0
10 Posted

How much memory does XStream consume?

0
10

This cannot be answered in general, but following topics have impact on the memory: • XML parser technology in use: You should use a streaming parser like Xpp3 or StAX. DOM-based parsers process the complete XML and create their document model in memory before the first converter of XStream is called. • Your object model: Is it necessary to keep the complete object graph in memory at once. As alternative you might use object streams or write custom converters that can load and save objects of your object model on the fly without adding them to the object graph physically. As example see the implementation of the XmlArrayList in combination with the FileStreamStrategy to keep parts of the object graph separate. • References: By default XStream supports references to the same object in an object graph. This implies that XStream keeps track of all serialized and deserialized objects internally. These references are kept with WeakReferences, so that the memory can be freed as soon as nobod

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.