You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Liu, Scott" <SL...@netsuite.com> on 2004/04/13 03:21:08 UTC

Is Axis creating a DOM object and hence it may cause memory issue?

I have read somewhere that Axis uses SAX parser and the memory is
basically well managed. But in org.apache.axis.message.SOAPBodyElement
class the getDocumentElement method is implemented as such

  

 private static Element getDocumentElement(InputStream input) {

        try {

            return XMLUtils.newDocument(input).getDocumentElement();

        } catch (Exception e) {

            throw new InternalException(e);

        }

    }

 

So the XMLUtils.newDocument(input) will return a DOM object? This
worries me a little bit.

 

When the InputStream contains 100MB xml data this DOM object is going to
consume a lot of memory (it will make the Axis not usable?). Am I
missing something here?

 

Thanks,

 

Scott

 


RE: Is Axis creating a DOM object and hence it may cause memory issue?

Posted by Anne Thomas Manes <an...@manes.net>.
The Axis Messaging interface returns a DOM.
Use the JAX-RCP interface instead. It returns Java types.
 
  _____  

From: Liu, Scott [mailto:SLiu@netsuite.com] 
Sent: Monday, April 12, 2004 9:21 PM
To: axis-user@ws.apache.org
Subject: Is Axis creating a DOM object and hence it may cause memory issue?
 
I have read somewhere that Axis uses SAX parser and the memory is basically
well managed. But in org.apache.axis.message.SOAPBodyElement class the
getDocumentElement method is implemented as such
  
 private static Element getDocumentElement(InputStream input) {
        try {
            return XMLUtils.newDocument(input).getDocumentElement();
        } catch (Exception e) {
            throw new InternalException(e);
        }
    }
 
So the XMLUtils.newDocument(input) will return a DOM object? This worries me
a little bit.
 
When the InputStream contains 100MB xml data this DOM object is going to
consume a lot of memory (it will make the Axis not usable?). Am I missing
something here?
 
Thanks,
 
Scott
 

RE: Is Axis creating a DOM object and hence it may cause memory issue?

Posted by Anne Thomas Manes <an...@manes.net>.
The Axis Messaging interface returns a DOM.
Use the JAX-RCP interface instead. It returns Java types.
 
  _____  

From: Liu, Scott [mailto:SLiu@netsuite.com] 
Sent: Monday, April 12, 2004 9:21 PM
To: axis-user@ws.apache.org
Subject: Is Axis creating a DOM object and hence it may cause memory issue?
 
I have read somewhere that Axis uses SAX parser and the memory is basically
well managed. But in org.apache.axis.message.SOAPBodyElement class the
getDocumentElement method is implemented as such
  
 private static Element getDocumentElement(InputStream input) {
        try {
            return XMLUtils.newDocument(input).getDocumentElement();
        } catch (Exception e) {
            throw new InternalException(e);
        }
    }
 
So the XMLUtils.newDocument(input) will return a DOM object? This worries me
a little bit.
 
When the InputStream contains 100MB xml data this DOM object is going to
consume a lot of memory (it will make the Axis not usable?). Am I missing
something here?
 
Thanks,
 
Scott