Heap size allocation in SUSE using MinRAMPercentage instead of MaxRAMPercentage values although heap size > 250 MB

I have a problem when defining usage of heap size using MinRAMPercentage and MaxRAMPercentage.

The MaxRAMPercentage value is used when heap size is > 250 MB while the MinRAMPercentage is used when heap size < 250 MB.

I have run the following 2 commands:

First command is with openjdk11

docker run -m 1GB openjdk:11 java -server -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:InitialRAMPercentage=80.0 -XX:MinRAMPercentage=50.0 -XX:MaxRAMPercentage=80.0 -XX:+PrintFlagsFinal -XshowSettings -version

It allocates around 820MB for the java heap size limit, thereby using the MaxRAMPercentage which is correct!

Second command is with SUSE provided openjdk

docker run -m 1GB armdocker.rnd.ericsson.se/proj-adp-cicd-drop/bob-java11mvnbuilder:latest java -server -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:InitialRAMPercentage=80.0 -XX:MinRAMPercentage=50.0 -XX:MaxRAMPercentage=80.0 -XX:+PrintFlagsFinal -XshowSettings -version

It allocates 512MB which it allocates using the MinRAMPercentageā€¦

So it seems that the First command java uses MaxRAMPercentage, while the second command java uses MinRAMPercentage. With SUSE it picks MinRAMPercentage 50%*1GB = 500 MB

Apparently there is a patch in SUSE provided jdk that switches to MinRAMPercentage although MaxRAMPercentage should be used for this heap size value (1 GB).

My questions:

  • What is the reasoning behind this patch in SUSE?
  • Is there a place where I can find more information
  • Is there a way to avoid this patch?

Thanks. Thomas