Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable String Deduplication on JDK 17+ #1380

Merged
merged 3 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions changelog/@unreleased/pr-1380.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
type: improvement
improvement:
description: |-
Enable String Deduplication on JDK 17+

G1 and Shenandoah GC support string deduplication as of JDK 17
* https://openjdk.java.net/jeps/192
* https://bugs.openjdk.org/browse/JDK-8264718

Only enable on JDK 17+ due to fix
https://bugs.openjdk.org/browse/JDK-8277981

JDK 18+ enable string deduplication for SerialGC, ParallalGC, and ZGC.
https://malloc.se/blog/zgc-jdk18
links:
- https://github.com/palantir/sls-packaging/pull/1380
- https://openjdk.java.net/jeps/192
- https://bugs.openjdk.org/browse/JDK-8264718
- https://malloc.se/blog/zgc-jdk18
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public final class LaunchConfig {
ImmutableList.of("-XX:+ShowCodeDetailsInExceptionMessages");
private static final ImmutableList<String> java15Options =
ImmutableList.of("-XX:+UnlockDiagnosticVMOptions", "-XX:+ExpandSubTypeCheckAtParseTime");

private static final ImmutableList<String> java17PlusOptions = ImmutableList.of(
"-XX:+UseStringDeduplication"); // only enable on JDK 17+ due to https://bugs.openjdk.org/browse/JDK-8277981

private static final ImmutableList<String> disableBiasedLocking = ImmutableList.of("-XX:-UseBiasedLocking");
// Disable C2 compilation for problematic structure in JDK 11.0.16, see https://bugs.openjdk.org/browse/JDK-8291665
private static final ImmutableList<String> jdk11DisableC2Compile =
Expand Down Expand Up @@ -175,6 +179,10 @@ static void action(Params params) {
javaVersion.compareTo(JavaVersion.toVersion("15")) == 0
? java15Options
: ImmutableList.of())
.addAllJvmOpts(
javaVersion.compareTo(JavaVersion.toVersion("17")) >= 0
? java17PlusOptions
: ImmutableList.of())
// Biased locking is disabled on java 15+ https://openjdk.java.net/jeps/374
// We disable biased locking on all releases in order to reduce safepoint time,
// revoking biased locks requires a safepoint, and can occur for non-obvious
Expand Down