Axis
  1. Axis
  2. AXIS-2749

SAX2EventRecorder throws Out of Memory exception during Deserialization

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 1.4
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Operating System: OS X 10.5.4, Java SE: 1.6, Java EE: 1.5, Axis: 1.4

      Description

      After an unspecified amount of time, usually less than twelve hours, a thread repeatedly deserializing SOAP calls will eventually throw a java.lang.OutOfMemoryError. For instance:
      Exception in thread "Thread-2" java.lang.OutOfMemoryError: Java heap space
      at org.apache.axis.message.SAX2EventRecorder$objArrayVector.add(SAX2EventRecorder.java:254)
      at org.apache.axis.message.SAX2EventRecorder.startEntity(SAX2EventRecorder.java:116)
      at org.apache.axis.encoding.DeserializationContext.startEntity(DeserializationContext.java:1178)
      at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:214)
      at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
      at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
      at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
      at org.apache.axis.client.Call.invoke(Call.java:2467)
      at org.apache.axis.client.Call.invoke(Call.java:2366)
      at org.apache.axis.client.Call.invoke(Call.java:1812)
      at com.opencalais.ws.CalaisSoapStub.enlighten(CalaisSoapStub.java:113)
      at com.opencalais.api.CalaisClient.enlighten(CalaisClient.java:155)
      at edu.caltech.cs.eventweb.calaistester.CalaisFeedSubmitter.processOne(CalaisFeedSubmitter.java:88)
      at edu.caltech.cs.eventweb.calaistester.CalaisFeedSubmitter.run(CalaisFeedSubmitter.java:143)
      at java.lang.Thread.run(Thread.java:637)

      It is worth noting that the thread in question maintains very little state itself. It pulls objects from a queue, makes a soap call with that object as a parameter, and then puts the result in another queue. That is all that is expected of that thread.

      This is either very similar or identical to the problem reported for version 1.2 reported here but unassigned: https://issues.apache.org/jira/browse/AXIS-2698

      I wanted to make sure this was also identified as a 1.4 problem. This bug is making the Axis library incredibly unstable for me.

        Issue Links

          Activity

          Hide
          Prakash C Rao added a comment -

          Yes, i too observed the same issue for our application with Axis 1.4. This bug really makes Axis 1.4 library useless for us. You can try out Axis2 1.5.1 and it's much stable version. I've done profiling for my application with Axis2 1.5.1 and it's very low on memory footprint. There are few best practices that you need to implement when you write client code such as stub pooling, creating only one configuration context and fine tunning http client parameters and after doing all this, i see low memory footprint with Axis2 1.5.1.

          As an alternate to Axis, i tried protocol buffer from google to exchange data and found this to be much simpler, clean, easily maintainable, faster and yet low on memory footprint. Protocol buffer uses java serialization mechanism and you can write an object to any outputstream (output stream of http connection with doPost method) and on the other side you can easily construct the object back. Since this works on java serialization, it's much faster compared to XML transfer.

          Show
          Prakash C Rao added a comment - Yes, i too observed the same issue for our application with Axis 1.4. This bug really makes Axis 1.4 library useless for us. You can try out Axis2 1.5.1 and it's much stable version. I've done profiling for my application with Axis2 1.5.1 and it's very low on memory footprint. There are few best practices that you need to implement when you write client code such as stub pooling, creating only one configuration context and fine tunning http client parameters and after doing all this, i see low memory footprint with Axis2 1.5.1. As an alternate to Axis, i tried protocol buffer from google to exchange data and found this to be much simpler, clean, easily maintainable, faster and yet low on memory footprint. Protocol buffer uses java serialization mechanism and you can write an object to any outputstream (output stream of http connection with doPost method) and on the other side you can easily construct the object back. Since this works on java serialization, it's much faster compared to XML transfer.
          Hide
          Gaurav added a comment -

          We have also noticed the same error while deparsing the XML response in Axis 1.4.

          java.lang.OutOfMemoryError
          Deserializati E org.apache.axis.encoding.DeserializationContext pushNewElement Exception: javax.xml.soap.SOAPException: java.lang.OutOfMemoryError

          at org.apache.axis.message.NodeImpl.setParentElement(NodeImpl.java:634)
          at org.apache.axis.encoding.DeserializationContext.pushNewElement(DeserializationContext.java:774)
          at org.apache.axis.message.SOAPHandler.startElement(SOAPHandler.java:94)
          at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
          at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
          at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
          at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
          at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
          at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
          at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
          at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
          at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
          at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
          at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
          at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
          at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
          at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
          at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
          at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
          at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
          at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
          at org.apache.axis.client.Call.invoke(Call.java:2767)
          at org.apache.axis.client.Call.invoke(Call.java:2443)
          at org.apache.axis.client.Call.invoke(Call.java:2366)
          at org.apache.axis.client.Call.invoke(Call.java:1812)

          Show
          Gaurav added a comment - We have also noticed the same error while deparsing the XML response in Axis 1.4. java.lang.OutOfMemoryError Deserializati E org.apache.axis.encoding.DeserializationContext pushNewElement Exception: javax.xml.soap.SOAPException: java.lang.OutOfMemoryError at org.apache.axis.message.NodeImpl.setParentElement(NodeImpl.java:634) at org.apache.axis.encoding.DeserializationContext.pushNewElement(DeserializationContext.java:774) at org.apache.axis.message.SOAPHandler.startElement(SOAPHandler.java:94) at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812)

            People

            • Assignee:
              Unassigned
              Reporter:
              Michael Olson
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Development