This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Web Services and the fly likes Out of Memory Error in my TransportMessage class Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "Out of Memory Error in my TransportMessage class " Watch "Out of Memory Error in my TransportMessage class " New topic
Author

Out of Memory Error in my TransportMessage class

John Mazz
Greenhorn

Joined: Oct 05, 2005
Posts: 3
Hi All,

Im a Java newbie who is having problems isolating the root cause for an out of Memory error I am getting when tring to transfer files larger then 20 megs using SOAP

I am working with some lecagy production code in a that is supose to upload a file from my server, and then upload into a 3rd party product via a SOAP call. This java appliation acts as a middle man that picks up files created by one application and then loads it into another.

the current code works fine on files under 20Megs, but generates an "Out of Memeory" error when they are larger then this.

Current JVM version 1.3.1
My current SOAP libs are Appache Axis... (dont know what version they are, but the files appear they are from 5/2002)

I suspect that somewhere in my AXIS jars the entire file is being read into memory insead of being buffered. Does this sound correct or is the poblem possible the older 1.3.1 verion JVM

Has anyone run across this or know a fix?

Thanks
Mazz
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12268
    
    1
I suspect that somewhere in my AXIS jars the entire file is being read into memory insead of being buffered.

I think you are correct - and possibly the entire file is being parsed, thus adding to the memory use.

Your toolkits are really out of date. Moving big files with SOAP should be done with "attachments" - see the SAAJ - Soap with Attachments for Java API.

The only quick fix is to give your app more memory and given that you have no control over the end application, thats probably what you are going to end up with. See the Java Tooldocs for your Java installation for command line control of memory allocation.

Bill


Java Resources at www.wbrogden.com
Ashutosh Shahi
Ranch Hand

Joined: Feb 06, 2005
Posts: 36
Not sure about Apache axis, but such a problem existed in Sun's implementation of saaj and has been resolved, See: https://saaj.dev.java.net/issues/show_bug.cgi?id=8


<a href="http://blogs.sun.com/roller/page/ashutosh" target="_blank" rel="nofollow">http://blogs.sun.com/roller/page/ashutosh</a>
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Out of Memory Error in my TransportMessage class
 
Similar Threads
Problem in using java to Store 1GB+ files in a MySQL database
how to resolve OutOfMemoryError
Installing Axis 1.4 jar files
Quick Question on fileupload in Struts2
IRAD 7: JVM Terminated. Exit Code 1 - SOLUTION