-
Bug
-
Resolution: Fixed
-
P3
-
11.0.2
-
b24
-
x86_64
-
linux
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8225862 | 14 | Bob Vandette | P3 | Resolved | Fixed | team |
ADDITIONAL SYSTEM INFORMATION :
Linux, as provided by the openjdk docker image `openjdk:11-jre`
A DESCRIPTION OF THE PROBLEM :
When Java container ergonomic options are used to set MaxHeapSize, they are unable to scale beyond a container of 128GB of RAM. For instance, when running `docker run -m200g -it --rm openjdk:11-jre java -XX:-UseCompressedOops -XX:MaxRAMPercentage=50 -version` Java only allocates a 64GB heap (50% of 128GB limit).
This appears to be due lines 1733-1735 of `src/hotspot/share/runtime/arguments.cpp`, where the effective physical memory is calculated as the minimum of the reported physical memory (in this case from the container limits) and the default value of MaxRAM (128GB):
```
julong phys_mem =
FLAG_IS_DEFAULT(MaxRAM) ? MIN2(os::physical_memory(), (julong)MaxRAM)
: (julong)MaxRAM;
```
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
docker run -m256g -it --rm openjdk:11-jre java -XX:-UseCompressedOops -XX:MaxRAMPercentage=100 -XshowSettings:vm -version
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
VM settings:
Max. Heap Size (Estimated): 256.00G
Using VM: OpenJDK 64-Bit Server VM
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment (build 11.0.2+9-Debian-3bpo91)
OpenJDK 64-Bit Server VM (build 11.0.2+9-Debian-3bpo91, mixed mode)
ACTUAL -
VM settings:
Max. Heap Size (Estimated): 128.00G
Using VM: OpenJDK 64-Bit Server VM
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment (build 11.0.2+9-Debian-3bpo91)
OpenJDK 64-Bit Server VM (build 11.0.2+9-Debian-3bpo91, mixed mode)
CUSTOMER SUBMITTED WORKAROUND :
When you know you're running in docker, you can set MaxRAM yourself using
-XX:MaxRAM=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)
FREQUENCY : always
Linux, as provided by the openjdk docker image `openjdk:11-jre`
A DESCRIPTION OF THE PROBLEM :
When Java container ergonomic options are used to set MaxHeapSize, they are unable to scale beyond a container of 128GB of RAM. For instance, when running `docker run -m200g -it --rm openjdk:11-jre java -XX:-UseCompressedOops -XX:MaxRAMPercentage=50 -version` Java only allocates a 64GB heap (50% of 128GB limit).
This appears to be due lines 1733-1735 of `src/hotspot/share/runtime/arguments.cpp`, where the effective physical memory is calculated as the minimum of the reported physical memory (in this case from the container limits) and the default value of MaxRAM (128GB):
```
julong phys_mem =
FLAG_IS_DEFAULT(MaxRAM) ? MIN2(os::physical_memory(), (julong)MaxRAM)
: (julong)MaxRAM;
```
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
docker run -m256g -it --rm openjdk:11-jre java -XX:-UseCompressedOops -XX:MaxRAMPercentage=100 -XshowSettings:vm -version
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
VM settings:
Max. Heap Size (Estimated): 256.00G
Using VM: OpenJDK 64-Bit Server VM
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment (build 11.0.2+9-Debian-3bpo91)
OpenJDK 64-Bit Server VM (build 11.0.2+9-Debian-3bpo91, mixed mode)
ACTUAL -
VM settings:
Max. Heap Size (Estimated): 128.00G
Using VM: OpenJDK 64-Bit Server VM
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment (build 11.0.2+9-Debian-3bpo91)
OpenJDK 64-Bit Server VM (build 11.0.2+9-Debian-3bpo91, mixed mode)
CUSTOMER SUBMITTED WORKAROUND :
When you know you're running in docker, you can set MaxRAM yourself using
-XX:MaxRAM=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)
FREQUENCY : always
- backported by
-
JDK-8225862 Java ergonomics limits heap to 128GB with disabled compressed oops
- Resolved
- csr for
-
JDK-8223957 Improve the behavior of Max RAM settings and UseCompressedOops
- Closed
- duplicates
-
JDK-8213175 Java ergonomics limits heap to 32GB to allow compressed oops
- Closed
- relates to
-
JDK-8225104 32-bit build failures after JDK-8222252
- Resolved
-
JDK-6887571 Increase default heap config sizes
- Closed
-
JDK-8224764 Create jtreg test for JDK-8222252
- Resolved
(1 relates to)
There are no Sub-Tasks for this issue.