How to Manage a Large Marshalling?
I am concerned that my present design using JAXB to marshall java objects into an xml document may strain system resources, given the right conditions. In this application, the xml schema has a large, repeating complex element, representing data used to generate a pdf document. Our initial estimates assume a specific run may contain information for as many as 2500 documents, with a resulting marshalled xml file of about 62Mb. I'm not sure what the jvm memory requirement is to store all those java objects before marhalling, but I have the feeling that if several such concurrent requests are running, it could exhaust memory.
What I'm wondering is, will I need to re-design in such a way that I marshall just the shell of the document to a file first, then marshall each instance of the repeating element and use file i/o to insert the fragment into the file? Or, are there features of JAXB that I'm not aware of that would that would allow me to do something like "start marshall", "marshall component", "marshall component" ... "end marshall"?