RFR: 8359348: G1: Improve cpu usage measurements for heap sizing [v7]

Ivan Walulya iwalulya at openjdk.org
Tue Aug 26 18:38:14 UTC 2025


> Hi,
> 
> Please review this patch which takes into account the impact of concurrent GC activity on mutator threads when computing the time spent on GC activity in a time interval. Previously, only the GC pause times were considered, and the overhead imposed by concurrent GC worker threads was not included.
> 
> With this change, we now estimate the impact of concurrent GC by dividing `elapsed_gc_cpu_time` by the number of CPUs. This provides an approximation of the additional time attributable to GC activity, assuming a fair CPU resource sharing.  Although this method does not account for contention on other shared resources (such as memory bandwidth or caches), it offers a reasonable estimate for most scenarios.
> 
> Testing: Tier 1

Ivan Walulya has updated the pull request incrementally with one additional commit since the last revision:

  cast

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/26351/files
  - new: https://git.openjdk.org/jdk/pull/26351/files/06ccc786..2f7d70a2

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=26351&range=06
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26351&range=05-06

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/26351.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26351/head:pull/26351

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


More information about the hotspot-gc-dev mailing list