RFR: 8308643: Incorrect value of 'used' jvmstat counter

Kim Barrett kbarrett at openjdk.org
Sun May 28 02:46:38 UTC 2023


Please review this change that fixes the space-used performance counters
provided by ParallelGC and SerialGC.

The prior fix for a problem in this area (JDK-8268265) wasn't correct.  It
used a static "last value" variable, for use when sampling is blocked by an
in-progress GC.  But there are multiple counters, so having one static "last
value" variable doesn't work.  (Not sure what I and my reviewers were thinking
at the time. Maybe we overlooked that there are multiple counters.)  The
solution is to associate a "last value" with each of the counters.

Also added a test of basic functionality (just accessibility) of the space
counters.  No regression test of the problem being fixed here, as its hard to
reliably set up.

Note: SpaceCounters and CSpaceCounters are very nearly identical.  It's likely
possible to refactor for more code sharing, which could be done as a followup.

Testing:
mach5 tier1

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

Commit messages:
 - test basic functionality
 - fix CSpaceCounters
 - fix SpaceCounters

Changes: https://git.openjdk.org/jdk/pull/14195/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14195&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8308643
  Stats: 150 lines in 5 files changed: 107 ins; 4 del; 39 mod
  Patch: https://git.openjdk.org/jdk/pull/14195.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14195/head:pull/14195

PR: https://git.openjdk.org/jdk/pull/14195


More information about the hotspot-gc-dev mailing list