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

David Holmes dholmes at openjdk.java.net
Thu Feb 18 05:14:40 UTC 2021


On Wed, 17 Feb 2021 18:22:01 GMT, Lutz Schmidt <lucy at openjdk.org> wrote:

>> Dear community,
>> may I please request reviews for this fix, improving the usefulness of method invocation counters.
>> - aggregation counters are retyped as uint64_t, shifting the overflow probability way out (185 days in case of a 1 GHz counter update frequency).
>> - counters for individual methods are interpreted as (unsigned int), in contrast to their declaration as int. This gives us a factor of two before the counters overflow.
>> - as a special case, "compiled_invocation_counter" is retyped as long, because it has a higher update frequency than other counters.
>> - before/after sample output is attached to the bug description. 
>> 
>> Thank you!
>> Lutz
>
> Lutz Schmidt has updated the pull request incrementally with one additional commit since the last revision:
> 
>   update copyright year

src/hotspot/share/oops/method.cpp line 511:

> 509:   tty->cr();
> 510: 
> 511:   // Internal counting is based on signed int counters. They tend to

Is there a good reason to not simply make them unsigned int?

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

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


More information about the serviceability-dev mailing list