Short term solution is to adjust your JVM -Xmx to something like 1024 whould get you through about 100MB in message size (bloats to up to 10x the message size in memory,) hope that helps.
Short term solution is to adjust your JVM -Xmx to something like 1024 whould get you through about 100MB in message size (bloats to up to 10x the message size in memory,) hope that helps.
Sorry, i didn't read your message closely enough the first time.
the problem is that yes, StAX will let you stream read your xml, but when you are building the SOAP message it must load the entire xml tree into memory. so sadly the answer right now is, no, there is no fix for this to force it to stream out but you should be able to change your connection timeout in code, i'm just not sure where off the top of my head, sorry.
I figured as much. This is what I did to increase the timeout:
Does anyone know if other web service frameworks have the same streaming limitation (e.g. Axis, CXF...)?Code:<bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate"> <property name="messageSender"> <bean class="org.springframework.ws.transport.http.CommonsHttpMessageSender"> <property name="acceptGzipEncoding" value="true"/> <property name="readTimeout" value="600000"/> </bean> </property> </bean>
i know axis has the limitation. AXIOM is the AXIs Object Model. And unless something has changed you will find the same problem everywhere. You could manually break the message up and send several smaller chunks, this could help but is a pain to code. another option going back to the -Xmx idea is also to set the -Xms to a higher value. the default is 64MB, when the jvm fills that it will request more memory and expand the heap up to the -xmx, if you set the xms higher then 64mb then the jvm will not take as much time building the message and thus you may be able to avoid your timeout issue.
problems on both solutions are:
if you adjust the jvm you are not going to really fix the timeout issue just help avoid it.
the problem with sending chunks is increased coupling between sender and receiver.
so can I then draw the conclusion that Spring-ws is only usable with low concurrent usage and/or small messages?
Have you heard of vtd-xml? It is a far more advanced option that excels in performance and memory usage at the same time...
http://vtd-xml.sf.net
I thought this too until I realized that log4j was using half of that 10x. I set the MessageTracing logger to ERROR that got it to about 5x. After increasing my eden space, I decreased it to about 2.5X for a 100mb file.
Logger Server Side:
Logger Client Side:Code:log4j.logger.org.springframework.ws.server.MessageTracing=ERROR
Heap and Eden increase:Code:log4j.logger.org.springframework.ws.client.MessageTracing=ERROR
Code:-Xms512m -Xmx1300m -XX:NewSize=256m