On Mon, 17 Nov 2025 20:32:52 GMT, Jonas Norlinder <[email protected]> 
wrote:

> Current trivial test for `TestGetTotalGcCpuTime` fails as some OSs may have a 
> slower update rate for the underlying CPU time thread counters than the code 
> anticipated, causing the test to fail which assumes that some work have been 
> performed and the count should be non-zero.
> 
> Solution: All GCs we are testing are tracing GCs. Therefore, add some marking 
> job to inflate the GC CPU time such that we can guarantee to observe a 
> non-zero value.

test/jdk/java/lang/management/MemoryMXBean/TestGetTotalGcCpuTime.java line 106:

> 104:             objs.add(new Object());
> 105:           }
> 106:           System.gc();

No concern that escape analysis will eliminate the allocations here?

Minor nit, should use 4-space indentation here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28362#discussion_r2536907844

Reply via email to