JDK-8369658 : Client emulation mode sets MaxRAM too late
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 11
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-10-13
  • Updated: 2025-10-27
  • Resolved: 2025-10-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26 masterFixed
Related Reports
Causes :  
Description
Client emulation mode flags set MaxRAM to 1G, which is then used to influence the heap size when setting it ergonomically in Arguments::set_heap_size(). However, when setting the client emulation mode flags from CompilerConfig::ergo_initialize(), the min, max and initial heap sizes have already been set, so the desired impact is lost. See code below.

jint Arguments::apply_ergo() {
  ...
  // Set heap size based on available physical memory
  set_heap_size();
  ...
  // Set compiler flags after GC is selected and GC specific
  // flags (LoopStripMiningIter) are set.
  CompilerConfig::ergo_initialize();
  ...
}

It looks like this was introduced in JDK-8184349.
Comments
Changeset: dcf46a0a Branch: master Author: Joel Sikström <jsikstro@openjdk.org> Date: 2025-10-23 08:22:32 +0000 URL: https://git.openjdk.org/jdk/commit/dcf46a0a195d7386ed0bc872f60eb9c586425cc8
23-10-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/27765 Date: 2025-10-13 11:25:04 +0000
13-10-2025