-
Enhancement
-
Resolution: Fixed
-
P3
-
9, 10
-
b11
We expect CDS to be widely used with the Server VM. However, the current default CDS setting for Server VM is -Xshare:off. This makes it cumbersome to use CDS.
We should change the default to -Xshare:auto, so as long as a CDS archive exists in the JDK, CDS will be automatically used without specifying extra flags.
In JDK 8 and before, RewriteBytecodes was disabled when CDS was enabled. This caused performance degradation in the Server Compiler (aka C2). However this has been fixed inJDK-8074345 since JDK 9, so there's no longer need to disable CDS by default with the Server VM.
The proposed change is to remove this block of code
http://hg.openjdk.java.net/jdk/hs/file/eebf559c9e0d/src/hotspot/share/runtime/arguments.cpp#l1819
#if COMPILER2_OR_JVMCI
// Shared spaces work fine with other GCs but causes bytecode rewriting
// to be disabled, which hurts interpreter performance and decreases
// server performance. When -server is specified, keep the default off
// unless it is asked for. Future work: either add bytecode rewriting
// at link time, or rewrite bytecodes in non-shared methods.
if (is_server_compilation_mode_vm() && !DumpSharedSpaces && !RequireSharedSpaces &&
(FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) {
no_shared_spaces("COMPILER2 default: -Xshare:auto | off, have to manually setup to on.");
}
#endif
We should change the default to -Xshare:auto, so as long as a CDS archive exists in the JDK, CDS will be automatically used without specifying extra flags.
In JDK 8 and before, RewriteBytecodes was disabled when CDS was enabled. This caused performance degradation in the Server Compiler (aka C2). However this has been fixed in
The proposed change is to remove this block of code
http://hg.openjdk.java.net/jdk/hs/file/eebf559c9e0d/src/hotspot/share/runtime/arguments.cpp#l1819
#if COMPILER2_OR_JVMCI
// Shared spaces work fine with other GCs but causes bytecode rewriting
// to be disabled, which hurts interpreter performance and decreases
// server performance. When -server is specified, keep the default off
// unless it is asked for. Future work: either add bytecode rewriting
// at link time, or rewrite bytecodes in non-shared methods.
if (is_server_compilation_mode_vm() && !DumpSharedSpaces && !RequireSharedSpaces &&
(FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) {
no_shared_spaces("COMPILER2 default: -Xshare:auto | off, have to manually setup to on.");
}
#endif
- csr for
-
JDK-8197967 Make -Xshare:auto the default for server VM
- Closed
- relates to
-
JDK-8074345 Enable RewriteBytecodes when VM runs with CDS
- Resolved
-
JDK-8188109 JVM should print a warning message that -Xshare:on may cause VM to abort start-up
- Closed
-
JDK-8204247 JEP 341: Default CDS Archives
- Closed