How much memory does XStream consume?
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