Skip to content

Commit cd45ba3

Browse files
Xiaolong Pengshipilev
Xiaolong Peng
authored andcommittedNov 19, 2024
8342041: Test gc/shenandoah/oom/TestClassLoaderLeak.java slow on Windows after JDK-8340490
Reviewed-by: shade, wkemper
1 parent 69c9f25 commit cd45ba3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
 

‎src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,9 @@ void ShenandoahPacer::pace_for_alloc(size_t words) {
253253
return;
254254
}
255255

256-
jlong const max_delay = ShenandoahPacingMaxDelay * NANOSECS_PER_MILLISEC;
257-
jlong const start_time = os::elapsed_counter();
258-
while (!claimed && (os::elapsed_counter() - start_time) < max_delay) {
256+
jlong const start_time = os::javaTimeNanos();
257+
jlong const deadline = start_time + (ShenandoahPacingMaxDelay * NANOSECS_PER_MILLISEC);
258+
while (!claimed && os::javaTimeNanos() < deadline) {
259259
// We could instead assist GC, but this would suffice for now.
260260
wait(1);
261261
claimed = claim_for_alloc<false>(words);
@@ -267,7 +267,7 @@ void ShenandoahPacer::pace_for_alloc(size_t words) {
267267
claimed = claim_for_alloc<true>(words);
268268
assert(claimed, "Should always succeed");
269269
}
270-
ShenandoahThreadLocalData::add_paced_time(current, (double)(os::elapsed_counter() - start_time) / NANOSECS_PER_SEC);
270+
ShenandoahThreadLocalData::add_paced_time(current, (double)(os::javaTimeNanos() - start_time) / NANOSECS_PER_SEC);
271271
}
272272

273273
void ShenandoahPacer::wait(size_t time_ms) {
@@ -276,7 +276,7 @@ void ShenandoahPacer::wait(size_t time_ms) {
276276
assert(time_ms > 0, "Should not call this with zero argument, as it would stall until notify");
277277
assert(time_ms <= LONG_MAX, "Sanity");
278278
MonitorLocker locker(_wait_monitor);
279-
_wait_monitor->wait((long)time_ms);
279+
_wait_monitor->wait(time_ms);
280280
}
281281

282282
void ShenandoahPacer::notify_waiters() {

‎test/hotspot/jtreg/gc/shenandoah/oom/TestClassLoaderLeak.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @summary Test OOME in due to classloader leak
2828
* @requires vm.gc.Shenandoah
2929
* @library /test/lib
30-
* @run driver/timeout=600 TestClassLoaderLeak
30+
* @run driver TestClassLoaderLeak
3131
*/
3232

3333
import java.util.*;

0 commit comments

Comments
 (0)
Please sign in to comment.