RFR: 8256938: Improve remembered set sampling task scheduling

Albert Mingkun Yang ayang at openjdk.java.net
Thu Nov 26 10:04:59 UTC 2020

On Thu, 26 Nov 2020 08:36:48 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>>> might round down to 299ms (when the interval is 300ms), even if we are just a microsecond away.
>> In that case, using `> 0` will just delay the start of the task for ~1ms, right? Doesn't sound like a serious problem. Similarly, `> 1` could cause the task to be run ~1ms earlier than its intended 300ms interval, right? Either way is fine, but I think `>0` is less surprising.
> One would think :) But the rounding comes back the other way around, if we reschedule to 1ms in the future, the service thread will look at the timestamp a bit later and then the time left will be rounded down to 0ms. So the effect will be that the task is rescheduled and run instantly over and over until the time since GC is over the interval.

Resolved my confusion via private chat. Thank you for the explanation. This PR is good to go.


PR: https://git.openjdk.java.net/jdk/pull/1428

More information about the hotspot-gc-dev mailing list