I'm using JAXB to generate the XML output. In the beginning the heavy .txt file is read, objects are created, after that stored in a list and then finally the list is passed to marshller. However the amount of objects is way too large (around 11 000 objects that take up about 700 MB of memory). Is there a way to genreate the .xml file on the runtime while objects are created or somehow decrease usage of memory deramatically to optimize performance of the program?

0 Answers