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.