MAX_HEAP not showing correctly on UI/logs

MAX_HEAP not showing correctly on UI/logs

book

Article ID: KB0070766

calendar_today

Updated On:

Products Versions
TIBCO DataSynapse GridServer 7.0.0,6.3.1,5.2.1

Description

We set the MAX_HEAP=25600m from server.bat/sh file but on UI (Manager configuration->Logging->Memory logging->Maximum Heap) or Logs (DiagnosticsPlugin), it will show some less memory like 25242m.

# The maximum heap size, in MB, as specified by the -Xmx<size> java option.
# 1024m if not set
MAX_HEAP=25600m
export MAX_HEAP

09/06/23 13:01:41.829 INFO: [DiagnosticsPlugin] t:[id:69] [M: 10776M/25242M/25242M] [T: D(11) O(820)] [5.2.1.178080 (5.2.1_hotfix07)] [JRE: 1.8.0_261/Oracle Corporation] [OS: Linux/2.6.32-754.50.1.el6.x86_64/amd64] [H: xldn2270pap]

This issue will present on GS 5.2.1,6.3.1,7.0.0 version only. The 7.1.0 version shows the correct memory in logs and UI.

The reason for this issue is a garbage collector. In the previous version, we used CMS GC and this GC uses some heap memory for itself and the remaining memory will be provided to the grid to use. Due to this, we can see in logs and UI some less memory than actual. 

In GS 7.1.0 we used G1 GC which will not use the heap memory and show the exact heap set in the server bat/sh file. Please find below the screenshot to understand the difference between the two GCs.





 

Issue/Introduction

We set the MAX_HEAP=25600m from server.bat/sh file but on UI it will show some less memory like 25242m.

Environment

Windows/Linus

Resolution

You need to change the GC to use the all heap memory. If you want to change the GC from your grid server you can just modify the below property from server.bat/sh file. In below property we used CMS(UseConcMarkSweepGC) GC if you want to change it to G1 then replace +UseConcMarkSweepGC with +UseG1GC value.

set CATALINA_OPTS=-Xrs -Dds.logToSystem=true -XX:+UseConcMarkSweepGC -Xmx%MAX_HEAP% -XX:MaxDirectMemorySize=256m -Dds.baseDir=%DS_DATA_DIR% -Duser.region=US -Duser.language=en %GRIDSERVER_OPTS% %GRIDSERVER_TOMCAT_OPTS%