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

Xiaolong Peng xpeng at openjdk.org
Sat Nov 16 08:22:17 UTC 2024


Fixing the regression on Windows caused by JDK-8340490, it bug is actually caused by difference behavior in `os:: os::elapsed_counter()`, Windows doesn't really high nanoseconds hi-res support,  instead nanoseconds it returns the the current value of the performance counter([link](https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter)).

Some additional changes are also included in the PR for better performance and throughput. 

### Tests
 - [x] Verify gc/shenandoah/oom/TestClassLoaderLeak.java on Windows, no regression at all(improved slightly by ~1s) 
 - [x] Run test suites hotspot_gc_shenandoah with linux-aarch64-server-fastdebug

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

Commit messages:
 - Use os::javaTimeNanos() instead of os::elapsed_counter()
 - format
 - os::elapsed_counter() is not always nanoseconds, e.g. Windows
 - Use os::elapsedTime()
 - Use os::javaTimeMillis instead of os::elapsed_counter() since we don't really need high-res time
 - Merge branch 'openjdk:master' into JDK-8342041
 - fix
 - Packer stop waiting whenever budget is replenished
 - Always take _wait_monitor lock at least once when claim_for_alloc fails
 - 8342041: Test gc/shenandoah/oom/TestClassLoaderLeak.java slow on Windows after JDK-8340490

Changes: https://git.openjdk.org/jdk/pull/22172/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22172&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8342041
  Stats: 27 lines in 2 files changed: 9 ins; 9 del; 9 mod
  Patch: https://git.openjdk.org/jdk/pull/22172.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22172/head:pull/22172

PR: https://git.openjdk.org/jdk/pull/22172


More information about the hotspot-gc-dev mailing list