## Summary
- Disable the collection of `PerfData` events using an always-on periodic task (`StatSampler`).
- Obsolete the then unused `PerfDataSamplingInterval` flag.
- Update `jstat -t` to calculate timestamps as offsets from `sun.rt.createVmBeginTime` instead of relying on sampled timestamps.
## Problem
The `StatSampler`, a small periodic task in `PerfData`, runs every 50ms but is rarely used in practice. Its impact varies by GC:
- G1/ZGC: Only records the current time in the shared `perfdata` file.
- Serial/Parallel GC: Updates heap usage counters (for eden, young, and old gen) in the shared file (values are copied from internal storage; JMX users remain unaffected). This is also done independently after each GC cycle.
- Note: Since counters are only updated post-GC, the reported eden usage without sampling will always be 0 (eden is empty after a GC cycle).
- No other sampling occurs.
The periodic sampling offers little benefit:
- Heap usage counters are already updated each GC cycle.
- The sampled timestamps are seldom used.
- Most run G1/ZGC where the task only collects timestamps.
- The sampling feature has remained effectively unused by developers since it became available.
The flag `PerfDataSamplingInterval` controls how often this sampling occurs, and is set to 50ms as default. This flag is obscure, only having a use with jstat and older GCs. Searching for this flag yields barely any results, and no results from tutorials or tuning guides. Thus, removing this flag should be very low risk and have little impact on users.
## Solution
1. Remove the `StatSampler` and associated sampling logic.
2. Obsolete `PerfDataSamplingInterval` (unused after sampling removal).
3. Change `jstat -t` to calculate timestamps using offsets from VM start time instead of sampled timestamps.
## Specification
- Remove the periodic task (`StatSampler`) and associated sampling logic.
- `PerfDataSamplingInterval`:
- Obsoleted in JDK 25, marked for removal in JDK 26.
- `jstat -t`:
- Calculate each timestamp using VM start time instead of sampling.