On Mon, 5 Oct 2026 16:25:36 GMT, Yunbo Zhang <[email protected]> wrote:

> Please review this small test fix.
> 
> With `-XX:ActiveProcessorCount=1`, `HeapDumpParallelTest` incorrectly expects 
> serial dumping, even though it configures two GC workers. The heap dump 
> succeeds, but the test fails because it rejects the parallel dump output.
> 
> **Fix:**
> 
> 1. Identify the target VM's GC from its startup log, including builds that 
> select Serial GC ergonomically.
> 2. Remove the processor-count check, since two workers can perform a parallel 
> dump even on a single CPU.
> 3. Request two threads explicitly for the compressed parallel dump case.
> 
> **Testing:**
> 
> - Passed with G1, Parallel, Serial, Epsilon, ZGC, and Shenandoah, each with 
> `ActiveProcessorCount=1` and `2`.
> - `serviceability/dcmd/gc`: 13 passed, 1 skipped, 0 failed.
> 
> 
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Changes requested by lmesnik (Reviewer).

test/hotspot/jtreg/serviceability/dcmd/gc/HeapDumpParallelTest.java line 120:

> 118: 
> 119:             // Expect parallel dump
> 120:             test(heapDumpFile, "-gz=9 -overwrite -parallel=2", false);

Wouldn't be better to left max(Runtime.getRuntime().availableProcessors(), 2) 
to use all cores?

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

PR Review: https://git.openjdk.org/jdk/pull/33212#pullrequestreview-5477399024
PR Review Comment: https://git.openjdk.org/jdk/pull/33212#discussion_r4236253660

Reply via email to