# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mydbsync.com/cloud-replication-main/troubleshooting/out-of-memory-exception.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
