<-- Back

What is the default garbage collector in a Mendix cloud container

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"]
The default garbage collector is Serial, unless more than 4 GiB of memory is allocated to an instance when an environment is scaled. When more than or equal to 4 GiB of memory is allocated, then G1 will be the default garbage collector for that instance, as described below:
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

 

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.

To provide feedback, please open a ticket here. Don't forget to include the article's URL along with the feedback you would like to provide.