RFR: 8294751: Zero: Allow larger default heaps

Ioi Lam iklam at openjdk.org
Wed Oct 5 16:45:16 UTC 2022


On Tue, 4 Oct 2022 09:37:48 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> Zero is currently defaulting to `MaxRAM=1G` on all machines. It is set in `compiler_globals.pd` under `#if !defined(COMPILER1) && !defined(COMPILER2) && !INCLUDE_JVMCI`.
> 
> Zero supports lots of GCs, and there is little sense to penalize it unnecessarily with too small heaps. After [JDK-8292847](https://bugs.openjdk.org/browse/JDK-8292847), this would allow G1 with reasonable heap size on most machines.
> 
> Motivational improvements, `SPECjvm2008:serial`:
> 
> 
> # Baseline, G1
> Serial.test  thrpt   10  1619.863 ± 16.694  ops/s
> 
> # Baseline, Serial
> Serial.test  thrpt   10  1094.438 ± 20.425  ops/s
> 
> # Patched, G1
> Serial.test  thrpt   10  1623.090 ± 17.553  ops/s
> 
> # Patched, Serial
> Serial.test  thrpt   10  1624.531 ± 15.792  ops/s  ; <---- matches G1 now, because young is not tiny
> 
> 
> Before:
> 
> 
> $ build/linux-x86_64-zero-release/jdk/bin/java -Xlog:gc -Xlog:gc+init Alloc.java
> [0.003s][info][gc     ] Using G1
> ...
> [0.005s][info][gc,init] Memory: 125G
> ...
> [0.005s][info][gc,init] Heap Region Size: 1M
> [0.005s][info][gc,init] Heap Min Capacity: 8M
> [0.005s][info][gc,init] Heap Initial Capacity: 16M
> [0.005s][info][gc,init] Heap Max Capacity: 256M
> 
> 
> After:
> 
> 
> $ build/linux-x86_64-zero-release/jdk/bin/java -Xlog:gc -Xlog:gc+init Alloc.java
> [0.003s][info][gc     ] Using G1
> ...
> [0.007s][info][gc,init] Memory: 125G
> ...
> [0.007s][info][gc,init] Heap Region Size: 16M
> [0.007s][info][gc,init] Heap Min Capacity: 16M
> [0.007s][info][gc,init] Heap Initial Capacity: 2016M
> [0.007s][info][gc,init] Heap Max Capacity: 30208M

Do we need to overhaul the other combinations as well? I don't see why we have to artificially limit the heap sizes. Here's the pd value for MaxRAM, which is defined identically for all platforms:

- no C2  = 1GB
- C2 on 32-bit = 4GB
- C2 on 64-bit = 128 GB

Also, if you want to do it for only ZERO for now, I think it's better to set the value inside compiler_globals_pd.hpp


#ifdef ZERO
define_pd_global(uint64_t,MaxRAM,                    128ULL*G);
#else 
define_pd_global(uint64_t,MaxRAM,                    1ULL*G);
#endif

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

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


More information about the hotspot-runtime-dev mailing list