Introduction
This article describes how to set the current or default value of the garbage collector (Serial or G1) used in a Mendix Cloud container or instance using a Custom Environment Variable.
In Mendix Cloud, the Garbage Collector (GC) in the Java Virtual Machine (JVM) is configured automatically within the instance. Two different garbage collectors can be configured:
Serial
G1
In an instance, the default garbage collector is Serial, unless more than 4 GiB of memory is allocated to an instance when an environment is scaled. Refer to Scaling Your Environment in Mendix Cloud to see the steps. When more than or equal to 4 GiB of memory is allocated, then G1 will be the default garbage collector for that instance. For more information, refer to the Mendix CloudFoundry Buildpack code, available in a GitHub repository.
Environment/Prerequisites
Applications hosted in Mendix Cloud
Instructions/Procedure
The current value of the garbage collector can be overridden using the JVM_GARBAGE_COLLECTOR Custom Environment Variable following these steps:
From Apps, go to the Environments page of the licensed app.
Click Details on the environment to override the value.
In the Runtime tab > Custom Environment Variables click on Add.
Find the
JVM_GARBAGE_COLLECTORenvironment variable under the Name dropdown menu.Set the value to Serial or G1.
Restart the application to apply the changes.
Outcome
After restarting the app, the current value for the garbage collector will be set to either Serial or G1. To verify the change has been applied, the current value of the garbage collector (Serial or G1) can be found in the startup logs, which are the logs after restarting the environment, as described in the article What is the default garbage collector in a cloud container.
Internal information related
- 221935
Additional information
- KBA related: What is the default garbage collector in a cloud container
- Mendix documentation: Custom Environment Variables
0 Comments