RFR: 8241678: Remove PerfData sampling via StatSampler [v3]

Casper Norrbin cnorrbin at openjdk.org
Tue May 13 14:20:48 UTC 2025


> Hi everyone,
> 
> This change removes the legacy `PerfData` sampling mechanism implemented through the `StatSampler` — an always-on periodic task that runs every 50ms my default. The sampling feature was originally introduced to collect performance counters and timestamps, but has since seen very little use.
> 
> For G1/ZGC, the only sampled value is a timestamp (`sun.os.hrt.ticks`). For Serial/Parallel, it also samples some heap space counters, but these are already updated after each GC cycle, making the sampling redundant. With sampling removed, the `PerfDataSamplingInterval` flag becomes obsoleted, as it no longer serves any purpose.
> 
> The only thing relying on the sampled timestamps is `jstat`: running `jstat -t` prints an extra column with the time since VM start. To preserve this funcitonality, we can calculate the timestamps as an offset from the already existing `sun.rt.createVmBeginTime` instead.

Casper Norrbin has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:

 - removed last traces of hrt.ticks
 - Merge branch 'master' into statsampler-removal
 - feedback fixes
 - removed the PerfDataSamplingInterval flag
 - calculate timestamp in jstat instead of sampling
 - StatSampler + sampling code removed

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/24872/files
  - new: https://git.openjdk.org/jdk/pull/24872/files/ed3670eb..fb53bd44

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24872&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24872&range=01-02

  Stats: 73116 lines in 2258 files changed: 50367 ins; 13675 del; 9074 mod
  Patch: https://git.openjdk.org/jdk/pull/24872.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24872/head:pull/24872

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


More information about the hotspot-gc-dev mailing list