Dan, You're right, it was the byte array that was becoming too big. After I commented out the first send to server and the MTOM client code seems to send file, as you said , now the OOM error has moved to server .
However - I am still splitting my hair to see what wrongdoing I did in my applications client which still continues to give me OOM error due to heap space Below isclient side stack trace from my client ( that uses https transport and a some more complex data structures) ... let me know if you notice anything untoward here Please note that this happens after I call the service method on my port object that uploads large object "port.uploadObject(objReqParam); Opened file:src/main/InfantHealthcare.jpg for read...( this is a BIG file) Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2271) at java.io.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:178) at org.apache.cxf.helpers.IOUtils.readBytesFromStream(IOUtils.java:235) at org.apache.cxf.io.CachedOutputStream.getBytes(CachedOutputStream.java:264) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRetransmits(HTTPConduit.java:2015) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2066) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1925) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:662) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:247) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) at $Proxy36.uploadObject(Unknown Source) at com.dell.dcca.webservice.objectstore.client.Client.main(Client.java:127) -- View this message in context: http://cxf.547215.n5.nabble.com/MTOM-OutOfMemory-tp547525p5738495.html Sent from the cxf-user mailing list archive at Nabble.com.