> ### Summary
> For Shenandoah and ZGC, safepoint workers were created at startup and only 
> used for heap dump and heap inspection. If heap dump or heap inspection never 
> runs, these threads consume memory without doing any work. For G1 and 
> Parallel, GC pauses and non-GC safepoints share the GC worker pool, so heap 
> dump and heap inspection don't need a separate worker pool. The downside is 
> that dump and inspection work contributes to GC CPU time, which can affect 
> how G1 sizes its heap.
> 
> ### Changes
> Safepoint workers are replaced with a diagnostic worker pool used by heap 
> dump and heap inspection. The diagnostic worker pool is created on the first 
> heap dump or heap inspection that requests more than one thread, if the 
> collector supports parallel heap iteration and `ParallelGCThreads` > 1. The 
> pool holds at most `ParallelGCThreads` workers, and workers stay alive until 
> the VM exits.
> 
> G1 and Parallel no longer lend their GC worker pool. ZGC's `ZRuntimeWorkers` 
> is deleted because it's no longer used. For Shenandoah, diagnostic workers 
> have no GCLAB and fall back to shared allocation when they evacuate objects.
> 
> ### Testing all passed
> - linux-x86_64-server-fastdebug: `hotspot:tier1_gc`, 
> `hotspot:tier1_serviceability`, `gc/shenandoah`
> - GHA
> - Internal CI pipeline
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Patrick Fontanilla has updated the pull request incrementally with one 
additional commit since the last revision:

  Move workers out of gc code and size them by cpu count

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/33218/files
  - new: https://git.openjdk.org/jdk/pull/33218/files/debf32c6..f230b716

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=33218&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=33218&range=00-01

  Stats: 349 lines in 16 files changed: 159 ins; 170 del; 20 mod
  Patch: https://git.openjdk.org/jdk/pull/33218.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/33218/head:pull/33218

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

Reply via email to