From a8b59c2795f73cd6d0a3a897a6bc8dee32de170c Mon Sep 17 00:00:00 2001 From: David Schlosnagle Date: Thu, 4 Aug 2022 23:04:32 -0400 Subject: [PATCH 1/2] Use Async JVM Unified Logging on JDK 17+ Avoid fflush from Unified JVM Logging (e.g. GC logs), see: https://aws.amazon.com/blogs/developer/asynchronous-logging-corretto-17/ https://bugs.openjdk.org/browse/JDK-8291898 https://bugs.openjdk.org/browse/JDK-8229517 https://github.com/openjdk/jdk/commit/41185d38f21e448370433f7e4f1633777cab6170 --- .../gradle/dist/service/tasks/LaunchConfigTask.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/tasks/LaunchConfigTask.java b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/tasks/LaunchConfigTask.java index 97c8d6b65..f30cb6c6e 100644 --- a/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/tasks/LaunchConfigTask.java +++ b/gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/tasks/LaunchConfigTask.java @@ -60,6 +60,8 @@ public abstract class LaunchConfigTask extends DefaultTask { ImmutableList.of("-XX:+ShowCodeDetailsInExceptionMessages"); private static final ImmutableList java15Options = ImmutableList.of("-XX:+UnlockDiagnosticVMOptions", "-XX:+ExpandSubTypeCheckAtParseTime"); + private static final ImmutableList java17PlusOptions = ImmutableList.of( + "-Xlog:async"); // remove if/when async is default, see https://bugs.openjdk.org/browse/JDK-8291898 private static final ImmutableList 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 jdk11DisableC2Compile = @@ -208,6 +210,10 @@ public final void createConfig() throws IOException { javaVersion.get().compareTo(JavaVersion.toVersion("15")) == 0 ? java15Options : ImmutableList.of()) + .addAllJvmOpts( + javaVersion.get().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 From 9e5fc9df660f0da904122f3ecbe5fb7693f4cb87 Mon Sep 17 00:00:00 2001 From: svc-changelog Date: Fri, 5 Aug 2022 03:08:17 +0000 Subject: [PATCH 2/2] Add generated changelog entries --- changelog/@unreleased/pr-1374.v2.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 changelog/@unreleased/pr-1374.v2.yml diff --git a/changelog/@unreleased/pr-1374.v2.yml b/changelog/@unreleased/pr-1374.v2.yml new file mode 100644 index 000000000..16e6d867d --- /dev/null +++ b/changelog/@unreleased/pr-1374.v2.yml @@ -0,0 +1,13 @@ +type: improvement +improvement: + description: |- + Use Async JVM Unified Logging on JDK 17+ + + Avoid fflush from Unified JVM Logging (e.g. GC logs), see: + + https://aws.amazon.com/blogs/developer/asynchronous-logging-corretto-17/ + https://bugs.openjdk.org/browse/JDK-8291898 + https://bugs.openjdk.org/browse/JDK-8229517 + https://github.com/openjdk/jdk/commit/41185d38f21e448370433f7e4f1633777cab6170 + links: + - https://github.com/palantir/sls-packaging/pull/1374