We've intermittently seen long timeouts on various startup benchmarks when running with G1 on SPARC since 9-b99.
From pstack output from a core dump taken from a java -version hanging on SPARC on a more recent binary:
ffffffff683b51e8 JVM_MonitorWait (100a529c8, 0, ea60, 100a52000, ffffffff68ede750, 100a529d0) + 2c8
ffffffff57c102d8 * java/lang/Object.wait(J)V+-8672
ffffffff57c1027c * java/lang/Object.wait(J)V+-2760
ffffffff57c08b88 * java/lang/ref/ReferenceQueue.remove(J)Ljava/lang/ref/Reference;+59
ffffffff57c088f8 * jdk/internal/ref/CleanerImpl.run()V+65
ffffffff57c08bd4 * java/lang/Thread.run()V+11
ffffffff57c08b88 * jdk/internal/misc/InnocuousThread.run()V+20
ffffffff57c0036c * StubRoutines (1)
Seems something might be up with the cleaner introduced in JDK-8138696 (and further improved in JDK-8146038), which now features an innocuous and tenacious thread that doesn't like being interrupted:
try {
// Wait for a Ref, with a timeout to avoid getting hung
// due to a race with clear/clean
Cleanable ref = (Cleanable) queue.remove(60 * 1000L);
if (ref != null) {
ref.clean();
}
} catch (Throwable e) {
// ignore exceptions from the cleanup action
// (including interruption of cleanup thread)
}
Trivial reproducer (on a SPARC T4-1 this is very likely to hang for ~60s after around 10-20 executions):
for i in {1..100}; do java -version; done