Details
-
Bug
-
Resolution: Fixed
-
P3
-
11, 12
-
b26
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8215768 | 13 | Claes Redestad | P3 | Resolved | Fixed | b02 |
JDK-8216118 | 12.0.1 | Claes Redestad | P3 | Resolved | Fixed | master |
JDK-8243645 | 11.0.8-oracle | Claes Redestad | P3 | Resolved | Fixed | b05 |
JDK-8244793 | 11.0.8 | Claes Redestad | P3 | Resolved | Fixed | b03 |
Description
java -XX:+UnlockDiagnosticVMOptions -XX:HandshakeTimeout=20 -version
Setting this to a low value, like 5 or 10 (ms) makes the VM likely to abort on startup on my machine:
$ java -XX:+UnlockDiagnosticVMOptions -XX:HandshakeTimeout=10 -version
#
# A fatal error has been detected by the Java Runtime Environment:
#
This does not happen with -Xint, -XX:-TieredCompilation or even -XX:TieredStopAtLevel=1, all these get through startup just fine even with -XX:HandshakeTimeout=1.
This indicates there's a handshake blocked by a compiler thread for an excessive amount of time, which consistently happen during startup. This appears to be a major contributor to increased work during startup since the handshake is causing excessive spin.
This turns out to be due to interaction between the NMethod sweeper thread - which is started very early and attempts early handshakes in NMethodSweeper::do_stack_scanning - and the stub code generation in OptoRuntime::generate(ciEnv* env) which compiles code in VM mode for ~10ms. Moving this to native mode resolves the issue, but a simpler and safer fix is to instruct the NMethod Sweeper thread not to do the scan on first run.
Attachments
Issue Links
- backported by
-
JDK-8215768 TieredCompilation C2 threads can excessively block handshakes
- Resolved
-
JDK-8216118 TieredCompilation C2 threads can excessively block handshakes
- Resolved
-
JDK-8243645 TieredCompilation C2 threads can excessively block handshakes
- Resolved
-
JDK-8244793 TieredCompilation C2 threads can excessively block handshakes
- Resolved
- relates to
-
JDK-8132849 Increased stop time in cleanup phase because of single-threaded walk of thread stacks in NMethodSweeper::mark_active_nmethods()
- Resolved
-
JDK-8211129 compiler/whitebox/ForceNMethodSweepTest.java fails after JDK-8132849
- Resolved