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.

Answers


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.


Need Your Help

Can Visual Studio 2010 work with classic ASP include files?

visual-studio visual-studio-2010 asp-classic

I'm testing VS 2010 with a classic ASP VBScript site I have to work on. It can auto complete and show reference for user functions. However it doesn't analyze 'include' files, so library functions ...

NSView in NSCell

objective-c xcode cocoa nstableview nscell

I've read a lot about this but i can't get it to work, i have a custom NSCell with this code

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.