corretto-8
corretto-8 copied to clipboard
backport of JDK-8230305 to Corretto (8 and 11)
Is your feature request related to a problem?
We are heavily using e.g. MaxRAMPercentage on our containers, running on Corretto 8 and Corretto 11 on Amazon Linux 2. With the upcoming AL 2022 cgroup v2 will be enabled by default and MaxRAMPercentage will not have an affect anymore.
Describe a solution you would like
Are there any plans to have cgroup v2 beeing supported on https://github.com/corretto/corretto-11/tree/develop/src/java.base/linux/classes/jdk/internal/platform and https://github.com/corretto/corretto-8/tree/develop/src/jdk/src/linux/classes/jdk/internal/platform ?
Describe alternatives you have considered
setting Xmx based on value in /sys/fs/cgroup/memory.max
Hi Christian(@pluralistix),
Thank you for informing of the issue with AL2022 and providing the JBS issue. We need to find out whether JDK-8230305 can be backported to OpenJDK11u. In such a case Corretto 11 will pick it up later.
Regarding Corretto 8, the situation might need more time because JDK-8230305 has dependencies which are not backported to OpenJDK8u as well as to Corretto 8. The risk of backporting those dependencies needs to be assessed.
Thanks, Evgeny
for OpenJDK11u https://github.com/openjdk/jdk11u-dev/pull/840
See also https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2022-February/012398.html
These changes have been backported to OpenJDK11 and will be released in Corretto-11 as part of the Q3 updates on July 19th.
a bit stating the obvious. yet...
Server Version: 20.10.17
Cgroup Version: 2
docker run --memory=1G amazonlinux bash -c 'yum install https://yum.corretto.aws/x86_64/Packages/java-11-amazon-corretto-devel-11.0.16.8-1.x86_64.rpm -y -q; grep .* /sys/fs/cgroup/memory/memory.limit_in_bytes /sys/fs/cgroup/memory.max 2>/dev/null; java -XX:MaxRAMPercentage=75.0 -XshowSettings -XX:+PrintFlagsFinal -version 2>&1 | grep -E " MaxHeapSize|Max. Heap Size|UseContainerSupport|Provider"'
/sys/fs/cgroup/memory.max:1073741824
size_t MaxHeapSize = 805306368 {product} {ergonomic}
bool UseContainerSupport = true {product} {default}
Max. Heap Size (Estimated): 742.44M
Provider: cgroupv2
docker run --memory=1G amazonlinux bash -c 'yum install https://yum.corretto.aws/x86_64/Packages/java-11-amazon-corretto-devel-11.0.15.9-1.x86_64.rpm -y -q; grep .* /sys/fs/cgroup/memory/memory.limit_in_bytes /sys/fs/cgroup/memory.max 2>/dev/null; java -XX:MaxRAMPercentage=75.0 -XshowSettings -XX:+PrintFlagsFinal -version 2>&1 | grep -E " MaxHeapSize|Max. Heap Size|UseContainerSupport|Provider"'
/sys/fs/cgroup/memory.max:1073741824
size_t MaxHeapSize = 25048383488 {product} {ergonomic}
bool UseContainerSupport = true {product} {default}
Max. Heap Size (Estimated): 23.33G
So 👍 for 11. Does "anyone" can say anything about 8?
This has already been backported to 11, but 8 is still pending
Still no word on 8?
This was backported to Corretto (and openjdk8) as part of 8u372, in 7eb2803b5b3 and 362cf7628b7