-
Notifications
You must be signed in to change notification settings - Fork 73
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
Disable C2 compiler for Java 11 #1370
Conversation
Generate changelog in
|
Disable the C2 compiler using the -XX:TieredStopAtLevel=1 flag. This prevents a potential memory leak issue https://bugs.openjdk.org/browse/JDK-8291665
050448d
to
3dfc34f
Compare
gradle-sls-packaging/src/main/java/com/palantir/gradle/dist/service/tasks/LaunchConfigTask.java
Outdated
Show resolved
Hide resolved
…rvice/tasks/LaunchConfigTask.java Co-authored-by: Carter Kozak <ckozak@ckozak.net>
Thanks, Yun! 👍 |
Released 7.22.0 |
@@ -61,6 +61,7 @@ public abstract class LaunchConfigTask extends DefaultTask { | |||
private static final ImmutableList<String> java15Options = | |||
ImmutableList.of("-XX:+UnlockDiagnosticVMOptions", "-XX:+ExpandSubTypeCheckAtParseTime"); | |||
private static final ImmutableList<String> disableBiasedLocking = ImmutableList.of("-XX:-UseBiasedLocking"); | |||
private static final ImmutableList<String> disableC2 = ImmutableList.of("-XX:TieredStopAtLevel=1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hang on guys - if you're just trying to turn off the C2 compiler, shouldn't this say -XX:TieredStopAtLevel=3
?? I think right now you're limiting the JVM to "simple" C1 and preventing it from doing "limited C1" and "Full C1" ??
https://www.baeldung.com/jvm-tiered-compilation#4-level-3--full-c1-compiledcode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try some benchmarks ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve forwarded some info internally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fascinating! Is it worth calling out the expected performance impact here though?? If an application was CPU bound then disabling C2 could make it run ~10x slower than before? Although maybe IO bound stuff wouldn't see as much of a slowdown?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For any future readers - we found a better way of doing this:
-XX:CompileCommand=exclude,sun/security/ssl/SSLEngineInputRecord.decodeInputRecord
Disable the C2 compiler using the -XX:TieredStopAtLevel=1 flag. This prevents a potential memory leak issue https://bugs.openjdk.org/browse/JDK-8291665