# Out of Memory Exception

If the Java Virtual Machine memory is insufficient to run the replication, tomcat will lead to the error as shown below.

*INFO: Completed Request:db\_setup*\
\&#xNAN;*Exception in thread "Thread-4"* ***java.lang.OutOfMemoryError**: Java heap space*\
&#x20;       *at java.util.Arrays.copyOfRange(Unknown Source)*

**Solution:**

This issue can be resolved by following the below steps.

* Go to installation folder *DBSyncCReplSF3* and then open bin folder. Identify the tomcat file *catalina.bat* in *bin* folder.

![](https://help.mydbsync.com/docs/download/attachments/31983568/Picture1.png?version=1\&modificationDate=1546870045000\&api=v2)

* Right click on the file *catalina.bat* to select edit. In *catalina.bat* file, search for the command ***set CATALINA\_OPTS=***
* If *set CATALINA\_OPTS* command is found, edit the values for Xms & Xmx to 1024. Usually this command will be available in the beginning, right after the command ***set JRE\_HOME=..\jre1.7.0\_13.*** The new command must be ***CATALINA\_OPTS="-Xms1024m --Xmx1024m"***

![](https://help.mydbsync.com/docs/download/attachments/31983568/Picture2.png?version=1\&modificationDate=1546870045000\&api=v2)

* If *set CATALINA\_OPTS* command is not found, include the new command to edit the default values for Xms & Xmx. The new command must be ***CATALINA\_OPTS="-Xms1024m --Xmx1024m"*** and must be placed after the command ***set JRE\_HOME=..\jre1.7.0\_13***
* If **Windows service** is used to run DBSync Cloud Replication, windows service must be re-registered before running the Replication.

<br>
