-
Notifications
You must be signed in to change notification settings - Fork 81
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
Exclude certain engine methods from Tier 4 compilation #1985
Conversation
Tested in Java11 and 17, see https://github.com/deephaven/deephaven-core/runs/5205478306?check_suite_focus=true - I will keep re-running this to ensure that 17 doesn't run into surprise issues. I'll put up a later PR to introduce the changes that lead to that nightly build as well. We might want to consider the c2-excludes.txt as a build output, or at least publish its contents with each release. It might also make sense to rename it, as we might refine this e.g. to also disable inlining if we find that a specific method is the actual problem, etc. |
set DEFAULT_JVM_OPTS=${defaultJvmOpts} | ||
|
||
@rem Customization for deephaven-core to reference a compiler directives file | ||
set DEFAULT_JVM_OPTS=%DEFAULT_JVM_OPTS% -XX:CompilerDirectivesFile=%APP_HOME%/c2-excludes.txt |
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.
On the unix version, you had -XX:+UnlockDiagnosticVMOptions
- is that not needed here?
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'll need to double check, I moved it a few times in my hopes of parameterize this file. I'll test on windows with Don tomorrow.
53ed0a9
to
e7ec74a
Compare
It turns out that start.bat doesn't run anyway on Win10 from main, so changing it at this time might be a mistake.
|
Maybe interesting in the future to examine -
I like the name The
Given our issues with long CLI arguments (on Windows), I wonder if we should try to craft our shell launchers to use star on the |
Downside of star is relying on the order that the shell uses, instead of deterministic classpath order from the specified list of jars. |
I don't think it actually relies on shell-globbing - I think that java is able to accept arguments and expand the star itself. But, this is a concern potentially for later on. |
4adcfbf
to
f60793f
Compare
This commit excludes ~11 methods from hotspot's Tier 4 (aka C2) JIT compilation. Each of these has been found crash the certain JVM implementations (across vendors, across OSes, and across hardware archetectures) when it compiles this code, but not consistently. By excluding only C2 in this way, we allow C1 (aka Tier 1-3) to still run, and get better performance than interpreted bytecode.
All existing ways to run code should be affected by this - running main()s or tests through either gradle or IntelliJ, and running our shell scripts to launch the server will all end up with a compiler directives file to disable c2 for these methods. Using the engine as a library is not fixed in this way, but this is a problem that can only be solved through documentation, to inform users that they should make sure to start the JVM with a specific set of flags.
An extra array of "devJvmArgs" is left in the io.deephaven.java-conventions plugin to make it easier to add more flags later for this kind of problem - it will automatically be included for all of the above categories.
Fixes #1529