RFR: 8297936: Use reachabilityFence to manage liveness in ClassUnload tests

Afshin Zafari duke at openjdk.org
Tue Feb 14 09:09:33 UTC 2023


### Description
Instead of using static instances or using an object in print to keep it alive, `java.lang.ref.Reference.reachabilityFence(Object)` is used to keep an object alive and avoid class unloading.

### Tests
linux-x64-debug, macosx-aarch64-debug, mach5 tier1-5

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

Commit messages:
 - 8297936: Use reachabilityFence to manage liveness in ClassUnload tests
 - 8297936: Use reachabilityFence to manage liveness in ClassUnload tests

Changes: https://git.openjdk.org/jdk/pull/12552/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12552&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8297936
  Stats: 22 lines in 3 files changed: 6 ins; 4 del; 12 mod
  Patch: https://git.openjdk.org/jdk/pull/12552.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12552/head:pull/12552

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


More information about the hotspot-runtime-dev mailing list