Writing a large XML file with Out Of Memory Error Java
I am developing an app for android, I need to create a rather large XML file.
I have tried this with a DOM document however because it resides in memory it throws an 'out of memory' error.
Can someone suggest an alternative solution? This is a XML file create from scratch.
I would write the XML to a Stream or Writer progressively as to traverse the data you want to turn into XML. This way you don't need much more memory than the original data.