SUSE 中的堆大小分配使用 MinRAMPercentage 而不是 MaxRAMPercentage 值,尽管堆大小 > 250MB

发布于 2025-01-13 10:08:25 字数 1282 浏览 6 评论 0原文

我在使用 MinRAMPercentage 和 MaxRAMPercentage 定义堆大小的使用时遇到问题。

当堆大小 > 时,使用 MaxRAMPercentage 值。 250 MB,而当堆大小 < 250 MB 时使用 MinRAMPercentage 250 MB。

我运行了以下 2 个命令:

第一个命令使用 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

它为java堆大小限制分配大约820MB,从而使用正确的MaxRAMPercentage!

第二个命令是使用SUSE提供的 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

它分配使用 MinRAMPercentage 分配的 512MB ..


所以看来 First 命令 java 使用 MaxRAMPercentage ,而第二个命令 java 使用 MinRAMPercentage。 对于 SUSE,它选择 MinRAMPercentage 50%*1GB = 500 MB

显然,SUSE 提供的 jdk 中有一个补丁可以切换到 MinRAMPercentage,尽管 MaxRAMPercentage 应该用于此堆大小值 (1 GB)。

我的问题:

  • SUSE 中这个补丁背后的原因是什么?
  • 有没有地方可以找到更多信息
  • 有没有办法避免这个补丁?

谢谢。 托马斯

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苍景流年 2025-01-20 10:08:25

据我所知,SUSE 有 1.3 GB 作为决策限制。也就是说,因为您有 1 GB <您的容器为 1.3 GB,它认为它很小,因此使用 MinRAMPercentage 来确定堆大小。不过我还没有找到相应的补丁。

As I know, SUSE has 1.3 GB as the decision limit. That is, as you have 1 GB < 1.3 GB for your container, it considers it small, and thus uses MinRAMPercentage to determine heap size. I could not find the corresponding patch yet, though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文