RFR: 8259349: -XX:AvgMonitorsPerThreadEstimate=1 does not work right [v4]
Daniel D.Daugherty
dcubed at openjdk.java.net
Fri Jan 8 23:20:58 UTC 2021
On Fri, 8 Jan 2021 23:15:55 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
>> src/hotspot/share/runtime/synchronizer.cpp line 1173:
>>
>>> 1171: Atomic::add(&_in_use_list_ceiling, (jint)-AvgMonitorsPerThreadEstimate);
>>> 1172: }
>>> 1173:
>>
>> Did you find that this can go negative? I can see that it could go to zero at shutdown maybe.
>
> In a previous round I changed the assert to:
> (l_in_use_list_ceiling >= 0, ...```
> and the Linux build complained about the assert always being true.
> This is because size_t is unsigned. (No complaint on macOSX.)
> what would happen if this option was set to max_jint? Is it a reasonable max?
The _in_use_list_ceiling would be set to a very large number and we would
be allowing a very large number of monitors before a deflation cycle, i.e., we
would probably never async deflate.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1992
More information about the hotspot-runtime-dev
mailing list