> For the complete documentation index, see [llms.txt](https://docs.mydbsync.com/cloud-replication-main/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mydbsync.com/cloud-replication-main/troubleshooting/out-of-memory-exception.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
