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

Thomas Schatzl tschatzl at openjdk.org
Mon Jul 28 11:29:56 UTC 2025


On Wed, 23 Jul 2025 07:15:21 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/g1Analytics.cpp line 174:
> 
>> 172:   // caches, therefore underestimate the impact of the concurrent GC activity on mutator threads.
>> 173:   uint num_cpus = (uint)os::active_processor_count();
>> 174:   num_cpus = MIN2(num_cpus, MAX2(ConcGCThreads, ParallelGCThreads));
> 
> A minor issue is that `UseDynamicNumberOfGCThreads` may not activate all `ConcGCThreads`. I think it is acceptable the wall-clock time "lost" by mutator threads is a best-effort approximation anyway.

Fwiw, G1 has both `ConcGCThreads` (for marking; 1/4th of `ParallelGCThreads`) and `ConcRefinementThreads` (for refinement; equal in count with `ParallelGCThreads`) which are active at the same time.
Not sure if only using `ConcGCThreads` (`ParallelGCThreads`?) is appropriate for this calculation.

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

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


More information about the hotspot-gc-dev mailing list