Integrated: 8241678: Remove PerfData sampling via StatSampler

Casper Norrbin cnorrbin at openjdk.org
Wed May 28 12:03:03 UTC 2025


On Fri, 25 Apr 2025 10:38:39 GMT, Casper Norrbin <cnorrbin at openjdk.org> wrote:

> 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.

This pull request has now been integrated.

Changeset: 6ebae6cd
Author:    Casper Norrbin <cnorrbin at openjdk.org>
Committer: Albert Mingkun Yang <ayang at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/6ebae6cded49f9b0b0d42899af3303647eca7848
Stats:     864 lines in 25 files changed: 150 ins; 655 del; 59 mod

8241678: Remove PerfData sampling via StatSampler

Reviewed-by: jsjolen, ayang

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

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


More information about the hotspot-dev mailing list