Apologies for the slow reply. I have seen LockSupoort.parkNanos cause 100% when running on 32 bit Linux (32 bit Linux uses a slightly different set of syscalls compared with 64 bit). I've not tested within a docker container.
It is worth noting that TimeUnit.NANOSECONDS.sleep(1L) will effectively degrade to Thread.sleep(1L). So you will see the reduction in CPU usage, but you will have higher latency than with the SleepingWaitStrategy.
// From TimeUnit.java
public void sleep(long timeout) throws InterruptedException {
if (timeout > 0) {
long ms = toMillis(timeout);
int ns = excessNanos(timeout, ms);
Thread.sleep(ms, ns);
}
}
// From Thread.java
public static void sleep(long millis, int nanos)
throws InterruptedException {
if (millis < 0) {
throw new IllegalArgumentException("timeout value is negative");
}
if (nanos < 0 || nanos > 999999) {
throw new IllegalArgumentException(
"nanosecond timeout value out of range");
}
if (nanos >= 500000 || (nanos != 0 && millis == 0)) {
millis++;
}
sleep(millis);
}