axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jared Klett <jkl...@gmail.com>
Subject OutOfMemoryError when submitting large SOAP requests to Axis
Date Thu, 02 Feb 2006 17:31:58 GMT
greetings all,

I've taken a contract job to improve the performance of a Java Web
Service based on Axis. The service is required to handle multiple
simultaneous SOAP requests that can be anywhere from  two to 100 MB in
size. So far, the service fails with an OutOfMemoryError when I submit
any more than one simultaneous request at a time.

I participated in a previous thread entitled "Status w/r/t memory
leaks..." started by Jesse Sightler. I've tried the Axis 1.3 final
release, as well as a version built from the trunk of the latest (as
of yesterday) SVN source tree.

The SOAP requests have a number of attachments in the form of
base64-encoded data, which look something like this:

<data sid="data_5">
<filename>spacer.gif</filename>
<mimedata>R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==</mimedata>
</data>

The content inside the <mimedata> tag can be extremely large - as I
mentioned, these requests can be upwards of 100 MB in size.

I've tweaked the JVM parameters, setting the max and initial heap
sizes, the perm gen heap size, as well as trying several different
options to change the behavior of the garbage collector - all to no
avail.

I've narrowed down the problem down to the point where I'm sure it's
happening somewhere inside of Axis - the request is submitted to
AxisServlet, then passed to SOAPMonitor via an invoke() call.

Here is a snippet of the debug log output before the OOM happens:

[] [2006-01-30 15:45:23,404] SAXOutputter - SAXOutputter.endElement
['' reporterCcc]
[] [2006-01-30 15:45:23,404] ProjectResourceBundle -
org.apache.axis.i18n.resource::handleGetObject(endElem00)
[] [2006-01-30 15:45:23,404] SerializationContext - End element reporterCcc
[] [2006-01-30 15:45:23,404] NSStack - NSPop (32)
[] [2006-01-30 15:45:23,404] SAXOutputter - SAXOutputter.endElement
['http://xxxxxxxx.yyyyyyy.com' fileTestSubmission]
[] [2006-01-30 15:45:23,404] ProjectResourceBundle -
org.apache.axis.i18n.resource::handleGetObject(endElem00)
[] [2006-01-30 15:45:23,404] SerializationContext - End element
q1:fileTestSubmission
[] [2006-01-30 15:45:23,404] NSStack - NSPop (32)
[] [2006-01-30 15:45:23,404] SAXOutputter - SAXOutputter.endElement
['http://schemas.xmlsoap.org/soap/envelope/' Body]
[] [2006-01-30 15:45:23,404] ProjectResourceBundle -
org.apache.axis.i18n.resource::handleGetObject(endElem00)
[] [2006-01-30 15:45:23,404] SerializationContext - End element soap:Body
[] [2006-01-30 15:45:23,404] NSStack - NSPop (32)
[] [2006-01-30 15:45:23,404] SAXOutputter - SAXOutputter.endElement
['http://schemas.xmlsoap.org/soap/envelope/' Envelope]
[] [2006-01-30 15:45:23,404] ProjectResourceBundle -
org.apache.axis.i18n.resource::handleGetObject(endElem00)
[] [2006-01-30 15:45:23,404] SerializationContext - End element soap:Envelope
[] [2006-01-30 15:45:23,404] ProjectResourceBundle -
org.apache.axis.i18n.resource::handleGetObject(empty00)
[] [2006-01-30 15:45:23,405] NSStack - NSPop (empty)
[] [2006-01-30 15:45:23,405] SAXOutputter - SAXOutputter.endDocument
[] [2006-01-30 15:45:38,782] ProjectResourceBundle -
org.apache.axis.i18n.resource::handleGetObject(exception00)
[] [2006-01-30 15:45:38,782] EXCEPTIONS - Exception:
java.lang.OutOfMemoryError: Java heap space

I have been looking at the source code to Axis, and I note that in
SOAPPart, around line 444, data is loaded via an InputStream into a
memory-resident byte array. So far that's the only place I can find
that might actually be causing the problem.

It seems logical that a large SOAP request that is separated into
attachments should be written to disk, and then parsed inside of a
buffer. Here is a link to an article with such a code example (under
"Receive and process a SOAP message with SAAJ", a little more than
halfway down the page):

http://www.javaworld.com/javaworld/jw-09-2003/jw-0912-webservices-p2.html

I've read the archives of this mailing list, so I know I'm not the
first one to run into this issue. So far, I have not found any
proposed solutions.

I'm going to continue to investigate, but I would really appreciate
some help or insights from the list. Thanks very much!

cheers,

- Jared

Mime
View raw message