RFR: 8261447: MethodInvocationCounters frequently run into overflow [v8]

Igor Veresov iveresov at openjdk.java.net
Tue Mar 2 21:11:51 UTC 2021


On Tue, 2 Mar 2021 20:59:46 GMT, Igor Veresov <iveresov at openjdk.org> wrote:

>> Then it will never happen. These values come from ```InvocationCounter::count()```. And it will never return a value > 2^31 - 1.
>
> Sorry, it can return 2^31. Which would be an indication of a counter overflow (InvocationCounter::count_limit == 2^31). Your code is correct in both senses. It is a counter overflow and a signed int overflow.

Oops, my arithmetic is bad again. InvocationCounter::count_limit is 2^30. So, I don't think there ever going to be an overflow that you're looking for. The sign bit is always 0. Or am I missing something again? :)

-------------

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


More information about the serviceability-dev mailing list