Configure a DataSource application’s 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.

Overview

You can specify the start and maximum size of a DataSource application’s JVM heap. 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.

Configuring a C DataSource’s embedded JVM heap

Liberator and Transformer are C DataSource applications, but use Deployment Framework configuration macros to configure the heap size of their embedded JVMs. See Configuring Liberator’s embedded JVM heap and Configuring Transformer’s embedded JVM heap.

To configure the heap size of a C DataSource’s embedded JVM, edit the file global_config/overrides/<blade-name>/DataSource/etc/java.conf and use the jvm-options configuration item to set the following two JVM options:

  • Initial heap size: -DXms{heap_start_size}{k|K|m|M|g|G}

  • Maximum heap size: -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 the configuration below:

jvm-options -DXms1g
jvm-options -DXmx1g

Configuring Liberator’s embedded JVM heap

The default size of Liberator’s JVM heap is 256MB. This is large enough to run Liberator’s JMX module and Caplin’s Permissioning Authentication Module (distributed with the Caplin Permissioning Service).

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

Configuring Transformer’s embedded JVM heap

The default size of Transformer’s JVM heap is 256MB. This is large enough to run Transformer’s JMX module, but not large enough to run Transformer’s Refiner module. For guidance on determining the optimal Java heap size for running Refiner, see Tuning Transformer’s JVM heap for Refiner.

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/Transformer/etc/java.conf
# The size of the Java heap (in megabytes)
define JVM_XMS_HEAP_SIZE        256
define JVM_XMX_HEAP_SIZE        256

Configuring a Java DataSource’s JVM heap

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:

  • Initial heap size: -DXms{heap_start_size}{k|K|m|M|g|G}

  • Maximum heap size: -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 arguments:

java -DXms1g -DXmx1g ...existing arguments

See also: