Products | Versions |
---|---|
TIBCO Data Virtualization | All supported versions |
This article provides instructions to enable Garbage collection(GC) and native memory logging (optional) in TIBCO Data Virtualization(TDV). These logs would help get insights in the GC process running for the TDV Server process.
Follow below steps to enable GC logging in TDV:
1. Stop the TDV Server.
2. Navigate to [TDV_Server_dir]/conf directory where the script_env.sh.sample file is present.
3. Make a copy of the script_env.sh.sample file in the same directory and name it as "script_env.sh".
4. Open script_env.sh with a text editor, and uncomment the last two lines (i.e. remove the '#' prefix):
CIS_SERVER_VM_ARGS=
export CIS_SERVER_VM_ARGS
5. Change the value of CIS_SERVER_VM_ARGS to include all the values in VM_ARGS from <TDV_install_dir>/conf/server/server.properties.
For Linux, this would be the "linux.vmargs=" line
Example:
--------------------------------------------------------------------
CIS_SERVER_VM_ARGS="-Ddrill.java.home=/TIBCO/TDV_Server_84/jdk -server -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/TIBCO/TDV_Server_84/logs -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xmx2048m -Djava.library.path=/TIBCO/TDV_Server_84/apps/server/lib/svn/lin64"
export CIS_SERVER_VM_ARGS
--------------------------------------------------------------------
NOTE: Make sure you add double-quotes around the value specified for CIS_SERVER_VM_ARGS.
6. Append the following to the CIS_SERVER_VM_ARGS line:
Note: make sure to replace "/opt/TIBCO/TDV_Server_8.5" with your own TDV installation pathname).
-Xlog:gc*,gc+ref=debug,gc+phases=debug,gc+age=debug,safepoint:file=/opt/TIBCO/TDV_Server_8.5/logs/gc.log:time:filecount=5,filesize=100M -XX:+PrintFlagsFinal -XX:+DisableExplicitGC XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics
Example
--------------------------------------------------------------------
CIS_SERVER_VM_ARGS="-Ddrill.java.home=/TIBCO/TDV_Server_84/jdk -server -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/TIBCO/TDV_Server_84/logs -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xms2048m -Xmx2048m -Djava.library.path=/TIBCO/TDV_Server_84/apps/server/lib/svn/lin64 -Xlog:gc*,gc+ref=debug,gc+phases=debug,gc+age=debug,safepoint:file=/TIBCO/TDV_Server_84/logs/gc.log:time:filecount=5,filesize=100M -XX:+PrintFlagsFinal -XX:+DisableExplicitGC"
export CIS_SERVER_VM_ARGS
-----------------------------------------------
Important Note:
-> All the flags in the CIS_SERVER_VM_ARGS should be in a single line in the script_env.sh file.
-> The filecount flag will create the numbers of files and the filesize will be the size of each GC log file in MB(s).
-> The "-XX:+DisableExplicitGC" argument is to ensure a Full GC event is not called when the heap is large. This will disable the action the 'Free Unused memory' button does from Studio > Manager > Memory.
-> It is a good idea to have both the -Xms and -Xmx flags set to the same. This is to ensure the entire JVM heap size is allocated when the JVM starts. If we don't specify the -Xms value the heap will be resized as the memory requirements increase and the resizing operations can add some additional overhead.
-> Optional: Only if requested by TIBCO Support, include the below flags for native memory logging:
-XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics are for native memory tracking.
7. Start the TDV Server.
8. You can check that that flags are in effect by running:
ps -elf | grep ServerBoot
And then verifying that the flags are displayed in the output. Example for reference:
0 S aprabhu 172853 172809 1 80 0 - 1290052 futex_ 17:01 pts/1 00:01:39 /TIBCO/TDV_Server_84/jdk/bin/java -Ddrill.java.home=/TIBCO/TDV_Server_84/jdk .... -Xlog:gc*,gc+ref=debug,gc+phases=debug,gc+age=debug,safepoint:file=/TIBCO/TDV_Server_84/logs/gc.log:time:filecount=5,filesize=100M -XX:+PrintFlagsFinal -XX:+DisableExplicitGC --add-exports=java.base/sun.security.provider= .... /TIBCO/TDV_Server_84/apps/base/lib/csbase.jar com.compositesw.base.boot.ServerBoot run
9. The gc.logs file will be created at the path mention in the "safepoint:file" flag.