RFR: 8354145: G1GC: keep the CompressedOops same as before when not setting HeapRegionSize explicitly [v2]

Tongbao Zhang duke at openjdk.org
Mon Apr 14 13:16:24 UTC 2025


> After [JDK-8275056](https://bugs.openjdk.org/browse/JDK-8275056), The max heap region size became 512M, and the calculation of CompressedOops based on the max_heap_size - max_heap_region_size.
> So before this patch, the CompressedOops will turn on below 32G - 32m, After this patch is 32G -512m.
> 
> When our Apps migrating from JDK11 to JDK21, the heap size parameters(Xmx32736m) will turn off the CompressedOops.
> 
> Since the current max ergonomics size is still 32m, We hoped that the original behavior will not be changed if HeapRegionSize is not explicitly set.
> 
> before this patch:
> 
> ./build/linux-x86_64-server-release/images/jdk/bin/java -Xmx32736m -XX:+PrintFlagsFinal -version | grep CompressedOops
>      bool UseCompressedOops                        = false                          {product lp64_product} {default}
> openjdk version "25-internal" 2025-09-16
> OpenJDK Runtime Environment (build 25-internal-adhoc.root.jdk)
> OpenJDK 64-Bit Server VM (build 25-internal-adhoc.root.jdk, mixed mode, sharing)
> 
> 
> after this patch:
> 
> ./build/linux-x86_64-server-release/images/jdk/bin/java -Xmx32736m -XX:+PrintFlagsFinal -version | grep CompressedOops
>      bool UseCompressedOops                        = true                           {product lp64_product} {ergonomic}
> openjdk version "25-internal" 2025-09-16
> OpenJDK Runtime Environment (build 25-internal-adhoc.root.jdk)
> OpenJDK 64-Bit Server VM (build 25-internal-adhoc.root.jdk, mixed mode, sharing)

Tongbao Zhang has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:

  G1GC: keep the CompressedOops same as before when not setting HeapRegionSize explicitly

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/24541/files
  - new: https://git.openjdk.org/jdk/pull/24541/files/6b139085..c31c7340

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24541&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24541&range=00-01

  Stats: 88 lines in 1 file changed: 88 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/24541.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24541/head:pull/24541

PR: https://git.openjdk.org/jdk/pull/24541


More information about the hotspot-gc-dev mailing list