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

Use Async JVM Unified Logging on JDK 17+ #1374

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
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
13 changes: 13 additions & 0 deletions changelog/@unreleased/pr-1374.v2.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public abstract class LaunchConfigTask extends DefaultTask {
ImmutableList.of("-XX:+ShowCodeDetailsInExceptionMessages");
private static final ImmutableList<String> java15Options =
ImmutableList.of("-XX:+UnlockDiagnosticVMOptions", "-XX:+ExpandSubTypeCheckAtParseTime");
private static final ImmutableList<String> java17PlusOptions = ImmutableList.of(
"-Xlog:async"); // remove if/when async is default, see https://bugs.openjdk.org/browse/JDK-8291898
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 @@ -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
Expand Down