RFR: 8308643: Incorrect value of 'used' jvmstat counter
Albert Mingkun Yang
ayang at openjdk.org
Thu Jun 15 10:46:00 UTC 2023
On Wed, 14 Jun 2023 21:56:50 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> Using the perf-counter to carry the periodic samples doesn't work. During
>> construction of the perf-counter, the sampler is called to provide the initial
>> value for the counter. Since the counter is not yet fully constructed and
>> accessible to the sampling function (_used is not yet initialized), this crashes.
>>
>> A workaround for that problem would be to add constructors that take both a
>> sampler and an initial value. That's kind of messy, and doesn't seem better
>> than the proposed solution at hand.
>
> BTW, I was wrong about the _used counter only being updated by GC. It is
> updated by the sampler to the newly sampled value. I hadn't fully chased
> through the call chains before.
Thank you for the clarification.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14195#discussion_r1230812091
More information about the hotspot-gc-dev
mailing list