8342041: Test gc/shenandoah/oom/TestClassLoaderLeak.java slow on Windows after JDK-8340490

Reviewed-by: shade, wkemper
This commit is contained in:
Xiaolong Peng 2024-11-19 20:18:54 +00:00 committed by Aleksey Shipilev
parent 69c9f2566e
commit cd45ba32f0
2 changed files with 6 additions and 6 deletions

View File

@ -253,9 +253,9 @@ void ShenandoahPacer::pace_for_alloc(size_t words) {
return;
}
jlong const max_delay = ShenandoahPacingMaxDelay * NANOSECS_PER_MILLISEC;
jlong const start_time = os::elapsed_counter();
while (!claimed && (os::elapsed_counter() - start_time) < max_delay) {
jlong const start_time = os::javaTimeNanos();
jlong const deadline = start_time + (ShenandoahPacingMaxDelay * NANOSECS_PER_MILLISEC);
while (!claimed && os::javaTimeNanos() < deadline) {
// We could instead assist GC, but this would suffice for now.
wait(1);
claimed = claim_for_alloc<false>(words);
@ -267,7 +267,7 @@ void ShenandoahPacer::pace_for_alloc(size_t words) {
claimed = claim_for_alloc<true>(words);
assert(claimed, "Should always succeed");
}
ShenandoahThreadLocalData::add_paced_time(current, (double)(os::elapsed_counter() - start_time) / NANOSECS_PER_SEC);
ShenandoahThreadLocalData::add_paced_time(current, (double)(os::javaTimeNanos() - start_time) / NANOSECS_PER_SEC);
}
void ShenandoahPacer::wait(size_t time_ms) {
@ -276,7 +276,7 @@ void ShenandoahPacer::wait(size_t time_ms) {
assert(time_ms > 0, "Should not call this with zero argument, as it would stall until notify");
assert(time_ms <= LONG_MAX, "Sanity");
MonitorLocker locker(_wait_monitor);
_wait_monitor->wait((long)time_ms);
_wait_monitor->wait(time_ms);
}
void ShenandoahPacer::notify_waiters() {

View File

@ -27,7 +27,7 @@
* @summary Test OOME in due to classloader leak
* @requires vm.gc.Shenandoah
* @library /test/lib
* @run driver/timeout=600 TestClassLoaderLeak
* @run driver TestClassLoaderLeak
*/
import java.util.*;