Java memory settings for the trading engine

Two parameters control the allowed range of the JVM heap size in for the Activator trading engine: Xms and Xmx (initial low and initial high, respectively). Both default to 256m in the Activator_install_directory/Activator/bin/startServer file. These parameters also govern the Java heap used by the Executive Node JVM.

The place to change the actual Xms and Xmx values used for the Control Node (CN) and Trading Engine (TE) JVM nodes is in the Activator/conf/jvmArguments.xml file. The best practice is to keep both parameters equivalent to each other's value for a given JVM. For example, the CN can have Xms512m and Xmx512m while the TE has Xms1024m and Xmx1024m, because within a JVM the values are equivalent.

Optimal value for the JVM

Setting the optimal value for the JVM is often a trial and error process, based on transaction size, transaction volumes, OS, hardware, embedded server configuration, etc. On most low-volume systems, no tuning is required. High-volume systems can typically benefit from tuning.

The effective maximum value you can use for this setting is 2048 MB. Note that, for values above 1024 MB, there is a risk that JAVA consumes more resources for memory management than it benefits from additional memory allotment.

Allow for mode metaspace and thread stacks

All of the Activator trading engine nodes reserve space outside the heap for metaspace (class metadata) and for thread stacks. Depending on the OS, for each thread, this might be around 1MB.

In any case, the values of the Java heaps combined must not exceed the physical memory of the machine. Additionally, be sure to reserve some free RAM for the OS to use (minimum recommended is one half Gigabyte).

The server starts automatically with approximately 100-150 threads. Additionally, any embedded servers that you have configured start their own thread pools. This may require additional space; therefore, in addition to what the OS requires, at least an extra GB is required for nodes,

To change the default heap size settings:

  1. Go to <Activator_install_directory>/conf/ and open the jvmarguments.xml file in an editor.
  2. Locate the following lines in the file (TE example):
  3. <NodeType type="TE"




  4. Replace the initial and maximum heap variables with values as shown in the following examples:
  5. <NodeType type="TE"




  6. Save the file.

Related Links