-
Enhancement
-
Resolution: Fixed
-
P4
-
8, 11, 15
-
b26
PerfData contains a periodic task (the StatSampler) the samples and writes a small number of counters to the PerfData file. This mechanism was introduced many years ago but has remained largely unused and redundant.
- For G1 and ZGC, it only records the current time.
- For Serial and Parallel, it updates heap usage counters, but these are already updated after each GC cycle.
- The sampled timestamp is rarely used.
- The controlling flag, -XX:PerfDataSamplingInterval is obscure and poorly documented.
This functionality adds overhead and complexity for little to no benefit.
This change removes the following:
- The StatSampler periodic task.
- The associated sampling logic in PerfData
- The -XX:PerfDataSamplingInterval flag, which is obsoleted in JDK 25, marked for removal in JDK 26.
In addition:
- The sun.os.hrt.ticks PerfData counter (the sampled timestamp), has been removed.
- jstat -t has been updated to compute current timestamps instead of relying on the sampled timestamp.
- The Eden usage counter for Serial and Parallel will always report 0, since eden is empty after each collection.
This change only affects tools that read directly from the PerfData file, such as jstat. Other monitoring tools relying on other mechanisms remain unaffected.
Using the flag in JDK 25 will produce an error:
java -XX:PerfDataSamplingInterval=10 --version
OpenJDK 64-Bit Server VM warning: Ignoring option PerfDataSamplingInterval; support was removed in 25.0
And will not work in JDK 26 onwards:
java -XX:PerfDataSamplingInterval=10 --version
Unrecognized VM option 'PerfDataSamplingInterval=10'
- For G1 and ZGC, it only records the current time.
- For Serial and Parallel, it updates heap usage counters, but these are already updated after each GC cycle.
- The sampled timestamp is rarely used.
- The controlling flag, -XX:PerfDataSamplingInterval is obscure and poorly documented.
This functionality adds overhead and complexity for little to no benefit.
This change removes the following:
- The StatSampler periodic task.
- The associated sampling logic in PerfData
- The -XX:PerfDataSamplingInterval flag, which is obsoleted in JDK 25, marked for removal in JDK 26.
In addition:
- The sun.os.hrt.ticks PerfData counter (the sampled timestamp), has been removed.
- jstat -t has been updated to compute current timestamps instead of relying on the sampled timestamp.
- The Eden usage counter for Serial and Parallel will always report 0, since eden is empty after each collection.
This change only affects tools that read directly from the PerfData file, such as jstat. Other monitoring tools relying on other mechanisms remain unaffected.
Using the flag in JDK 25 will produce an error:
java -XX:PerfDataSamplingInterval=10 --version
OpenJDK 64-Bit Server VM warning: Ignoring option PerfDataSamplingInterval; support was removed in 25.0
And will not work in JDK 26 onwards:
java -XX:PerfDataSamplingInterval=10 --version
Unrecognized VM option 'PerfDataSamplingInterval=10'
- csr for
-
JDK-8241701 Remove PerfData sampling via StatSampler
-
- Closed
-
- relates to
-
JDK-8358891 Remove the PerfDataSamplingIntervalFunc code
-
- Resolved
-
-
JDK-8246020 -XX:+UsePerfData is enabled by default and slows down VM bootstrap by 6%
-
- Closed
-
- links to
-
Commit(master) openjdk/jdk/6ebae6cd
-
Review(master) openjdk/jdk/24872