function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rohits83rohits83 

java.lang.OutOfMemoryError: Java heap space.

I need to push large files to Content folder to salesforce.com using the java API. I'm passing data to salesforce.com using SOAP messages.

 

I'm able to push files upto 7MB but if I push the files larger than 7MB I get the following error

java.lang.OutOfMemoryError: Java heap space

 

I have increased the heap size to 1024MB but of no use. The eclipse.ini file looks like 

 

-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms128m
-Xmx1024m
-XX:PermSize=64M
-XX:MaxPermSize=128M

 

Can someone please suggest how can this problem be resolved.

 

rohits83rohits83

I'm able to resolve the OutofMemory problem by increasing the memory size of the application that was trying to upload the document in the content folder. I had success in pushing the document of size 20 MB. To push the file of 20 MB to salesforce it took around 4-5 mins.

 

Now I'm trying to push a file of 30 MB and I'm getting no response back from salesforce.com.  

mpiercempierce
Given that you've already had issues with memory, check that you're not spending too much time in GC. If you're using Sun's JDK, you can use jconsole to attach to a running jvm and see information on GC (and lots of other things). If GC time isn't too overwhelming, you can use the Thread tab to get stack traces of individual threads to see if you're actually blocking on Salesforce responding or waiting on some other layer in your SOAP stack.