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

Disable C2 compiler for Java 11 #1370

Merged
merged 3 commits into from
Aug 3, 2022
Merged

Conversation

atrocities
Copy link
Contributor

Disable the C2 compiler using the -XX:TieredStopAtLevel=1 flag. This prevents a potential memory leak issue https://bugs.openjdk.org/browse/JDK-8291665

@changelog-app
Copy link

changelog-app bot commented Aug 3, 2022

Generate changelog in changelog/@unreleased

Type
See change types. Select one:

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Disable C2 compiler for Java 11

Disable the C2 compiler using the -XX:TieredStopAtLevel=1 flag. This prevents a potential memory leak issue https://bugs.openjdk.org/browse/JDK-8291665

Check the box to generate changelog(s)

  • Generate changelog entry

Disable the C2 compiler using the -XX:TieredStopAtLevel=1 flag. This
prevents a potential memory leak issue
https://bugs.openjdk.org/browse/JDK-8291665
@atrocities atrocities force-pushed the yzhou/disable-c2-on-11 branch from 050448d to 3dfc34f Compare August 3, 2022 21:56
…rvice/tasks/LaunchConfigTask.java

Co-authored-by: Carter Kozak <ckozak@ckozak.net>
@carterkozak
Copy link
Contributor

Thanks, Yun! 👍

@atrocities atrocities requested a review from carterkozak August 3, 2022 22:11
@bulldozer-bot bulldozer-bot bot merged commit a20866f into develop Aug 3, 2022
@bulldozer-bot bulldozer-bot bot deleted the yzhou/disable-c2-on-11 branch August 3, 2022 22:17
@svc-autorelease
Copy link
Collaborator

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");
Copy link
Contributor

@iamdanfox iamdanfox Aug 3, 2022

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

https://community.oracle.com/tech/developers/discussion/4499712/jvm-c1-c2-compiler-thread-high-cpu-consumption

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try some benchmarks ;-)

Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Contributor

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

#1372

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants