# Increase Heap Memory

## Introduction

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

{% hint style="success" %}
*Completed Request:db\_setup*\
\&#xNAN;*Exception in thread "Thread-4"* ***java.lang.OutOfMemoryError**: Java heap space*\
\&#xNAN;*at java.util.Arrays.copyOfRange(Unknown Source)*
{% endhint %}

## **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 the *bin* folder.

![](https://help.mydbsync.com/docs/download/attachments/53903658/image2021-6-9_20-26-12.png?version=1\&modificationDate=1623250603000\&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/53903658/image2021-6-9_20-26-25.png?version=1\&modificationDate=1623250603000\&api=v2)

* If *set CATALINA\_OPTS* command is not found, including 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.
