Out of Memory Java Heap Space Error
Note: For CopyStorm versions 10.56.6 and higher, Java memory parameters can be provided without modifying the CopyStorm start script. For more details, please see this page.
CopyStorm uses the default settings for Java heap space. Most of the times this works well, but if you are seeing an Out of Memory error referencing Java Heap Space you may need to increase the memory allowance for CopyStorm. Settings can be adjusted as described in the “CopyStorm.bat” file, but the exact settings will depend on the size needed for the data in your Salesforce instance.
The most common reason to adjust the default memory settings is that a large content item (usually an Attachment, Document, or ContentVersion) is too large to fit in available CopyStorm memory. CopyStorm requires 3 to 4 times the size of the largest content item. Here are the steps to find the largest content items in your Salesforce:
In the management menu found by clicking on your name in the upper right-hand corner, go to:
Setup -> Data Management -> Storage Usage -> Overall Top Files by Storage Utilization
Increasing CopyStorm’s Memory Limit on Windows
- Use a 64-bit Java JRE if possible.
- Increase the amount of heap space available by setting the JVM_ARGS parameter as showin in the CopyStorm.bat file. This file can be edited.
- The following example sets the min and max memory allocations to 300 and 1000 megabytes, respectively:
set JVM_ARGS=-Xms300m -Xmx1000m
- The following example sets the min and max memory allocations to 300 and 1000 megabytes, respectively:
Increasing CopyStorm’s Memory Limit on Linux
- Use a 64-bit Java JRE if possible.
- Increase the amount of heap space by modifying the last line of the CopyStorm.sh script, adding memory allocation rules immediately after the “$JAVA”.
- The following example sets the min and max memory allocations to 300 and 1000 megabytes, respectively:
“$JAVA” -Xms300m -Xmx1000m -cp (… see the file for the rest of the command)
- The following example sets the min and max memory allocations to 300 and 1000 megabytes, respectively: