Change the size of the JVM heap

Here’s how to change the size of the heap in your DataSource application’s Java Virtual Machine (JVM) from the default settings. You might need to do this for performance reasons.

Specifying the JVM heap size

You can specify the start size and the maximum size of DataSource’s JVM. Oracle recommend that you set the start size and the maximum size to the same value to minimise garbage collections.

The method for configuring the JVM is dependent on the type of DataSource.

For more information on the heap options available on Oracle’s HotSpot VM, see Java HotSpot VM Heap Size Options on the Oracle website.

Liberator’s embedded JVM

To configure the heap size of Liberator’s embedded JVM, edit global_config/overrides/servers/Liberator/etc/java.conf and change the values assigned to the macros below:

global_config/overrides/servers/Liberator/etc/java.conf
# The size of the Java heap (in megabytes)
define JVM_XMS_HEAP_SIZE        256
define JVM_XMX_HEAP_SIZE        256

Transformer’s embedded JVM

To configure the heap size of Transformer’s embedded JVM, edit global_config/overrides/servers/Transformer/etc/java.conf and change the values assigned to the macros below:

global_config/overrides/servers/Liberator/etc/java.conf
# The size of the Java heap (in megabytes)
define JVM_XMS_HEAP_SIZE        256
define JVM_XMX_HEAP_SIZE        256
The default heap size of 256MB is enough to run Transformer’s JMX interface, but not enough to run Refiner. For guidance on setting the JVM heap size to accommodate the requirements of Refiner, see …​

Java DataSource’s JVM

To configure the heap size of the JVM used to run a Java DataSource, edit the file <dfw_root>/kits/<java-datasource-name>/DataSource/bin/start-jar.sh file and add the following command line arguments to the java command used to run the DataSource:

  • -DXms{heap_start_size}{k|K|m|M|g|G}

  • -DXmx{heap_max_size}{k|K|m|M|g|G}

For example, to set the start and maximum size for the JVM heap to 1 gigabyte, add -DXms1g -DXmx1g to the java command’s command line arguments:

java -DXms1g -DXmx1g ...original arguments

See also: