Setting Java Heap Space for CData Sync Cross-Platform Edition

  • 18 August 2023
  • 0 replies

Userlevel 1

Thanks to recent product improvements, it is now possible to configure Java Heap Space settings for the Cross Platform edition of Sync on Windows machines! This allows you to set a higher maximum value for the Java Heap space, which is sometimes required with Sync jobs that are replicating large datasets. This feature is supported in cross-platform versions of CData Sync 23.3.8608.0 and newer. 


By default, a Java virtual machine will automatically assign a maximum heap space of 1/4 of the available system memory and a minimum space of 1/64 of system memory. On machines with limited memory, the Java Virtual Machine may assign too little a maximum memory to heap space for large Sync operations which can result in job failures with Java Heap Space errors. 

On these newer Sync releases, you will be able to set Heap Space flags in the "sync.exe.config" file that will persist after every startup and shutdown. To do this you first have to locate the "sync.exe.config" file in your Sync installation. In standard Sync installations on Windows devices, this should be located at: 
"C:\Program Files\CData\CData Sync\sync.exe.config" 
You will need to open this XML Configuration File as an administrator to save any edits. Once there, the steps to set your heap space flags are short. As an example, simply add the following after the startup statement to specify a minimum Java Heap Space of 2GB and a maximum Heap Space of 10GB on service startup: 


    <add key="JAVA_OPTS" value="-Xms2g -Xmx10g"/> 


“-Xms2g” represents a minimum heap space size of 2GB. 

“-Xms10g” represents a maximum heap space size of 10GB. 

Once in place, your entire sync.exe.config file would look like the this: 


It is important to note that you do not need a minimum heap space flag to make use of this feature. In fact, it may often be better to let the Java Virtual Machine decide a minimum value so that the actual memory used can grow dynamically with need. While we want enough space to be available for jobs to succeed (what the maximum value is allowing), we should allow a JVM to use the minimal amount of memory needed to save on performance and memory operations. 

Another important note is that the maximum heap space should never be set to the total available system memory as the machine will need space for additional processes and applications. 

This topic has been closed for comments