RFR: 8308643: Incorrect value of 'used' jvmstat counter
Kim Barrett
kbarrett at openjdk.org
Wed Jun 14 21:59:57 UTC 2023
On Tue, 30 May 2023 13:59:06 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> The _used counters only seem to be updated by GCs. The take_sample function reports "current" data.
>
> Can `take_sample` update `_used` instead? IOW, what's the fundamental reason for having two distinct counters here?
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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14195#discussion_r1230209819
More information about the hotspot-gc-dev
mailing list