When using DOMWriter example with sun JDK1.1.8 on Windows NT 4,
I get the following error message with an XML file of 1.5 Mega bytes.

java.lang.OutOfMemoryError: 
        at
org.apache.xerces.dom.DeferredDocumentImpl.createChunk(DeferredDocumentImpl.java:1386)
        at
org.apache.xerces.dom.DeferredDocumentImpl.ensureCapacity(DeferredDocumentImpl.java:1294)
        at
org.apache.xerces.dom.DeferredDocumentImpl.createNode(DeferredDocumentImpl.java:1310)
        at
org.apache.xerces.dom.DeferredDocumentImpl.createTextNode(DeferredDocumentImpl.java:389)
        at
org.apache.xerces.parsers.DOMParser.ignorableWhitespace(DOMParser.java:1117)
        at
org.apache.xerces.framework.XMLParser.processWhitespace(XMLParser.java:2088)
        at
org.apache.xerces.readers.UTF8Reader.scanContent(UTF8Reader.java:2182)
        at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1134)
        at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1138)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1177)
        at
dom.wrappers.NonValidatingDOMParser.parse(NonValidatingDOMParser.java:102)
        at dom.DOMWriter.print(DOMWriter.java:188)
        at dom.DOMWriter.main(DOMWriter.java:405)


The problem occurs when I'm under the machine memory limit.

With JDK1.2.2 that's works fine but it tooks 35 Mb of memory to parse
the file and after this,
to print the file through the "public void print(Node node)" recursive
method the memory
grows of 40 Mb more. But in the method there is no object creation !!!

Does anybody know why the "print" method tooks so much memory ?

Thanks for any answer.

Frederic Bauchet

Reply via email to