RFR: 8345266: java/util/concurrent/locks/StampedLock/OOMEInStampedLock.java JTREG_TEST_THREAD_FACTORY=Virtual fails with OOME [v3]
Patricio Chilano Mateo
pchilanomate at openjdk.org
Wed Dec 18 16:21:20 UTC 2024
On Wed, 18 Dec 2024 13:43:43 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Improve comments
>
> test/jdk/java/lang/Thread/virtual/MonitorEnterWaitOOME.java line 59:
>
>> 57: final boolean testWait = args.length >= 1 ? Boolean.parseBoolean(args[0]) : false;
>> 58: final long timeout = testWait && args.length == 2 ? Long.parseLong(args[1]) : 0L;
>> 59:
>
> At some point we might have to add VThreadRunner.ensureParallelism(2) to main to ensure there are at least two carriers. Just thinking of JTREG_TEST_THREAD_FACTORY=Virtual on one core systems, a configuration that seems to come sometimes with ATR.
Added.
> test/jdk/java/lang/Thread/virtual/MonitorEnterWaitOOME.java line 126:
>
>> 124: private static void awaitState(Thread thread, Thread.State expectedState) {
>> 125: // Don't call anything that might allocate from the Java heap.
>> 126: while (thread.getState() != expectedState) {}
>
> I think I would put Thread.onSpinWait() in this loop to reduce the overhead of the spin.
I added it here and in the other loops.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22780#discussion_r1890505143
PR Review Comment: https://git.openjdk.org/jdk/pull/22780#discussion_r1890505883
More information about the hotspot-runtime-dev
mailing list