How does memory management work with the BW engine and what configurations can be set for the BW engine to tune memory usage?

How does memory management work with the BW engine and what configurations can be set for the BW engine to tune memory usage?

book

Article ID: KB0091769

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Resolution:
All process variables in a running process instance are stored in memory and consume system resources. Memory saving mode allows memory used by a process variable to be released when the value of the variable is no longer needed. When using the memory saving mode, as each activity is executed, the list of process variables is evaluated to determine if subsequent activities in the process refer to the variable. If no activities refer to the variable, the memory used by the variable is released.

Memory saving mode can reduce the memory used by actively running process instances, as well as potentially improve the performance of checkpoints. By default, memory saving mode is disabled, but you can enable memory saving mode for specific process instances by setting the EnableMemorySavingMode.<processname> property to true. You can enable the memory saving mode for all process instances by setting the EnableMemorySavingMode property to true.

When Java does garbage collection on its own and the garbage collection thread has a low priority, you may see memory growth. You can adjust some of the Garbage Collection parameters. For example, you can use the following property in your tra file:

java.extended.properties=-Xincgc  -XX:NewSize=128m  -XX:MaxNewSize=128m  

Java manages garbage collection using generations or memory pools holding objects of different ages. Collection is performed for a generation when the memory assigned to that generation is filled up. Therefore, collection frequency is determined by the amount of memory assigned to generations. After setting the total Java heap size, you should also estimate the amount of memory required for the young generation.

The young generation is the first generation, where new objects are created. Collections of objects in the young generation are called 'minor collections'. By avoiding frequent minor collections, the engine throughput can be increased.

To set the young generation heap size, use the following parameters:

     NewRatio  The ratio between the amount of memory for the young generation and all other generations. This is the default parameter used to size the young generation.
     NewSize  The lower bound number of megabytes of memory.
     MaxNewSize  The upper bound number of megabytes of memory. This value should not exceed one-half of the total JVM heap size.

The following values are recommended as a starting point:

java.extended.properties=-XX: NewSize=128m -XX: MaxNewSize=256m

Increasing the new generation size increases engine throughput for larger numbers of short-lived objects. A general guideline for this value is 25% of -Xmx, the maximum heap size. Setting NewSize and MaxNewSize to the same value fixes the young generation memory size to that value.

Additionally, you can force the JVM to do a Full GC by calling System.gc() inside the Java code activity at the end of the job processing. However, frequent execution of Full GC has a negative impact on BW engine performance.

It should be given special attention when developing custom Java code to avoid any memory leaks in the libraries/src that may cause the BW engine to run Out of Memory.

Issue/Introduction

How does memory management work with the BW engine and what configurations can be set for the BW engine to tune memory usage?

Additional Information

Also see:
KB:23516(Comprehensive coverage of BW engine tuning, BW memory tuning/usage, performance tuning/improvements, best practices etc )