How to change Java Garbage collection to 'G1GC' scheme in TIBCO Data Virtualization?

How to change Java Garbage collection to 'G1GC' scheme in TIBCO Data Virtualization?

book

Article ID: KB0077032

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization 7.0.7, 7.0.8

Description

This article outlines the steps to change Java Garbage collection to use 'G1GC' scheme in TIBCO Data Virtualization.

Note:
TIBCO Data Virtualization 7.0.7 and 7.0.8, uses JRE8 which comes with a new garbage collection scheme named G1GC, which is better at managing large memory footprints. 
Although TDV started using JRE8 in 7.0.7, it didn't start using the G1GC scheme until TDV 8.0 and higher. 

Issue/Introduction

This article outlines the steps to change java Garbage collection to use 'G1GC' scheme in TIBCO Data Virtualization

Environment

UNIX, Windows

Resolution

To enable the new G1GC setting, we work with script_env.sh (UNIX) or script_env.bat (Windows). 

If script_env is not implemented, follow the below steps:

1. Navigate to [TDV_Server_Install_dir]\conf folder.
2. Copy [TDV_Server_Install_dir]\conf\script_env.sh.sample (or .bat for Windows) and create new file named script_env.sh (or .bat) in the same directory. 
3. Open script_env.sh with a text editor and to uncomment (remove “rem” for windows/ remove '#' for UNIX) from the line that contains:
    rem set CIS_SERVER_VM_ARGS
4. Change the value of CIS_SERVER_VM_ARGS to include values in <os>vmargs="..." (<os>: current operating system) from [TDV_Server_Install_dir]\conf\server\server.properties file.
Eg: set CIS_SERVER_VM_ARGS="-server -XX:NewRatio=6 -XX:-UseGCOverheadLimit -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=[TDV_Server_Installation_dir]/logs -XX:-ReduceInitialCardMarks -XX:+ExplicitGCInvokesConcurrent -XX:+UseConcMarkSweepGC -Xmx2048m"
(b) Paste this value in the script_env.sh for CIS_SERVER_VM_ARGS and save the changes.

After script_env is implemented, follow the below steps:
1. Replace the old GC settings with the new values.
Old values: 
-XX:NewRatio=6 -XX:-UseGCOverheadLimit -XX:PermSize=64m -XX:MaxPermSize=1024m -XX:-ReduceInitialCardMarks -XX:+ExplicitGCInvokesConcurrent -XX:+UseConcMarkSweepGC

New values:
-XX:+UseG1GC -XX:MaxGCPauseMillis=200
2. Save file with new changes.
For Windows OS it will look something like the following. The Xmx memory setting and HeapDumpPath will be different, and other OSes will have different settings as well:
set CIS_SERVER_VM_ARGS="-server -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=[TDV_Server_Install_dir]/logs -Xmx385024m -XX:+UseG1GC -XX:MaxGCPauseMillis=200"

3. Restart the TDV server.
4. Verify the changes from [TDV_Server_Install_dir]\logs\cs_monitor.out log file. You should see lines similar to this:
ServerPropertiesManager : Detected [TDV_Server_Installation_dir]\conf\script_env.bat
ServerPropertiesManager : Detected CIS_SERVER_VM_ARGS environment variable overrides VM_ARGS
ServerPropertiesManager : Changing VM_ARGS to "-server -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=[TDV_Server_Installation_dir]/logs -Xmx2048m -XX:+UseG1GC -XX:MaxGCPauseMillis=200"