GOGC
The GOGC variable sets the initial garbage collection target percentage. A collection is triggered when the ratio of freshly allocated data to live data remaining after the previous collection reaches this percentage.
Garbage collection refers to the process of managing heap memory allocation: free the memory allocations that are no longer in use and keep the memory allocations that are being used. Garbage collection significantly affects the performance of your app.
Deploying the app on TIBCO Cloud
To set the variable value, navigate to your app, click Environment controls, click Engine variables, and set the variable.
The default is 1600. Setting it to a higher value (for example, GOGC=1600), delays the start of a garbage collection cycle until the live heap has grown to 1600% of the previous size. Setting it to a lower value (for example, GOGC=20), causes the garbage collector to be triggered more often as lesser new data can be allocated to the heap before triggering a collection.
Case Study
This use case illustrates the impact of the GOGC variable on performance.
In this low latency scenario, you can observe significant improvement in-app performance while increasing the GOGC variable value from 100 to 1600. It is advisable to test this value for the specific scenario and understand its impact before tuning. You can get the best-suited value by running the performance test in your test environment.
GOGC value can be tuned based on the workload and available resources after validating your test environment.