On Thu, 16 Aug 2007, Nicolas Baumann wrote:

hello,

I'm having a problem with a large xml flow with fop, generating an OutOfMemory
exception.
i'm currently doing this :
Source src = new StreamSource(new ByteArrayInputStream(xml.toByteArray()));

What is "xml"?  A string? If you already have a DOM tree, use a DOMSource:

   Source src = new DOMSource(xml);

or if it's a String

   Source src = new SAXSource(new InputSource(new StringReader(xml)))

That should at least avoid doubling the XML characters.



what should I do to optimize memory ?

Thanks,
Nicolas.

HTH,

Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to