RFR: 8364503: gc/g1/TestCodeCacheUnloadDuringConcCycle.java fails because of race printing to stdout [v2]
Thomas Schatzl
tschatzl at openjdk.org
Mon Aug 4 08:05:04 UTC 2025
On Fri, 1 Aug 2025 13:44:41 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:
>>
>> * review ayang
>
> test/hotspot/jtreg/gc/g1/TestCodeCacheUnloadDuringConcCycle.java line 165:
>
>> 163: // can start.
>> 164: System.out.println(TestCodeCacheUnloadDuringConcCycle.AFTER_FIRST_CYCLE_MARKER);
>> 165: System.out.flush();
>
> I thought println already flushes the stdout. Why is explicit flush needed?
The spec (javadoc) does not define whether the `PrintStream` for `System.out` is one that does auto flushing afaict. However the current implementation does that, so I removed the explicit `flush()` call.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26592#discussion_r2250721141
More information about the hotspot-gc-dev
mailing list