Introduction
A Garbage Collector (GC) in the Java Virtual Machine (JVM) is automatically set within the cloud container or instance. In this case, two different garbage collectors can be configured:
- Serial
- G1
This article explains the current value of the garbage collector (Serial or G1) used in a cloud container or instance, which is determined based on the memory allocated to a runtime instance.
Environment
Applications hosted in any deployment type
Details
The garbage collector value is set in the Mendix Cloud Foundry Buildpack code, as described below:
DEFAULT_GC_COLLECTOR = "Serial"
SUPPORTED_GC_COLLECTORS = ["Serial", "G1"]
jvm_garbage_collector = DEFAULT_GC_COLLECTOR
if limit >= 4096:
# override collector if memory > 4G
jvm_garbage_collector = "G1"
In some deployment types, such as Mendix Cloud, Cloud Foundry, and SAP BTP, 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.
In the startup logs, the Serial garbage collector is shown as follows:
- For Cloud Foundry platform apps:
INFO: JVM garbage collector is set to [Serial]
- For Kubernetes platform apps:
Picked up JAVA_TOOL_OPTIONS: XX:+UseSerialGC
In the startup logs, the G1 garbage collector is shown as follows:
- For Cloud Foundry platform apps:
INFO: JVM garbage collector is set to [G1]
- For Kubernetes platform apps:
Picked up JAVA_TOOL_OPTIONS: XX:+UseG1GC
The default garbage collector value can be overridden by following the steps described in the article How to override the default garbage collector value in a Mendix Cloud container.
Internal information related
- 221935, 190864
- C03PKGG8J8H/p1724331993380469
Additional information
- KBA related: How to override the default garbage collector value in a Mendix Cloud container
- Mendix documentation:
0 Comments