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

Thomas Schatzl tschatzl at openjdk.org
Thu Jul 24 09:48:58 UTC 2025


On Wed, 23 Jul 2025 06:31:04 GMT, Man Cao <manc at openjdk.org> wrote:

>> Ivan Walulya has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits:
>> 
>>  - cleanup after merge
>>  - Merge remote-tracking branch 'upstream/master' into ConcCPUImpact
>>  - Merge branch 'NormalizeTiming' into ConcCPUImpact
>>  - Thomas suggestion
>>  - Thomas Review
>>  - reorder
>>  - concurrent gc impact
>>  - clean out
>>  - init
>
> src/hotspot/share/gc/g1/g1Policy.cpp line 678:
> 
>> 676:   double cur_gc_cpu_time_ms = _g1h->elapsed_gc_cpu_time() * MILLIUNITS;
>> 677: 
>> 678:   double concurrent_gc_cpu_time_ms = cur_gc_cpu_time_ms - prev_gc_cpu_pause_end_ms;
> 
> `CollectedHeap::elapsed_gc_cpu_time()` includes  `_vmthread_cpu_time` and `string_dedup_cpu_time`. Should we exclude VM threads and StringDedup threads' CPU time from `concurrent_gc_cpu_time_ms`? Otherwise non-GC activities could affect G1's heap sizing decisions.

VMThread cpu time only contains VM thread cpu time for GC VM operations; string deduplication is a GC/memory management activity.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26351#discussion_r2228023769


More information about the hotspot-gc-dev mailing list