Configure a DataSource application’s JVM heap

Here’s how to configure the size of the heap in your DataSource application’s Java Virtual Machine (JVM) from the default settings.

Overview

By default, Java 8 determines the initial and maximum sizes of the JVM heap based on the host’s operating system and total physical memory. As detailed in Parallel collection: Default Heap Size in Oracle’s Java 8 documentation, the default maximum heap size for a 64-bit server JVM is 25% of the total physical memory, with an upper boundary of 32GB.

Although the default maximum heap size of a JVM cannot be greater than 32GB, a configured maximum heap size can be greater than 32GB.

Caplin recommend that you always set initial and maximum sizes for a DataSource application’s JVM heap.

Configuring heap size for a C DataSource’s embedded JVM

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: -Xms{heap_start_size}{k|K|m|M|g|G}

  • Maximum heap size: -Xmx{heap_max_size}{k|K|m|M|g|G}

For example, to set the initial and maximum size for the JVM heap to 1 gigabyte, add the configuration below:

jvm-options -Xms1G
jvm-options -Xmx1G

Configuring heap size for Liberator’s embedded JVM

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 LIBERATOR_JVM_XMS_HEAP_SIZE        256
define LIBERATOR_JVM_XMX_HEAP_SIZE        256

Configuring heap size for Transformer’s embedded JVM

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 heap size for a 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:

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

  • Maximum heap size: -Xmx{heap_max_size}{k|K|m|M|g|G}

For example, to set the initial size and the maximum size for the JVM heap to 1 gigabyte, prepend -Xms1G -Xmx1G to the java command’s arguments:

java -Xms1G -Xmx1G existing_arguments

See also: