RFR: 8305896: Alternative full GC forwarding

Roman Kennke rkennke at openjdk.org
Thu Apr 27 12:41:56 UTC 2023


Currently, the full-GC modes of Serial, Shenandoah and G1 GCs are forwarding objects by over-writing the object header with the new object location. Unfortunately, for compact object headers ([JDK-8294992](https://bugs.openjdk.org/browse/JDK-8294992)) this would not work, because the crucial class information is also stored in the header, and we could no longer iterate over objects until the headers would be restored. Also, the preserved-headers tables would grow quite large. I propose to add an alternative forwarding mechanism using a forwarding table that would be used for compact object headers.

The change introduces a new (experimental) flag -XX:[+|-]UseAltGCForwarding. This flag is not really intended to be used by end-users. Instead, I intend to programatically enable it with compact object headers once they arrive (i.e. -XX:+UseCompactObjectHeaders would turn on -XX:+UseAltGCForwarding), and the flag is also useful for testing purposes. Once compact object headers become the default and only implementation, the flag and old implementation could be removed. Also, [JDK-8305898](https://bugs.openjdk.org/browse/JDK-8305898) would also use the same flag to enable an alternative self-forwarding approach (also in support of compact object headers).

Testing:
 - [x] hotspot_gc -UseAltGCForwarding
 - [x] hotspot_gc +UseAltGCForwarding
 - [x] tier1 -UseAltGCForwarding
 - [x] tier1 +UseAltGCForwarding
 - [x] tier2 -UseAltGCForwarding
 - [x] tier2 +UseAltGCForwarding

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

Commit messages:
 - Add gtest for SlidingForwarding
 - Some cleanups
 - Fix 32 bit builds
 - Improve handling of Serial GC spaces; some refactorings
 - Implement fallback-hashtable for G1 serial compaction
 - 8305896: Alternative full GC forwarding

Changes: https://git.openjdk.org/jdk/pull/13582/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13582&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8305896
  Stats: 755 lines in 22 files changed: 723 ins; 0 del; 32 mod
  Patch: https://git.openjdk.org/jdk/pull/13582.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13582/head:pull/13582

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


More information about the shenandoah-dev mailing list