RFR: 8350905: Shenandoah: Releasing a WeakHandle's referent may extend its lifetime

William Kemper wkemper at openjdk.org
Tue Mar 11 23:40:24 UTC 2025


When weak handles are cleared, the `nullptr` is stored with the `ON_PHANTOM_OOP_REF` decorator. For concurrent collectors using a SATB barrier like Shenandoah, this may cause the referent to be enqueued and marked when it would be otherwise unreachable. The problem is especially acute for Shenandoah's generational mode, in which a young region holding the otherwise unreachable referent, may become trash after the referent is enqueued for old marking. Shenandoah's store barrier should be modified to not enqueue WEAK or PHANTOM stores in the SATB buffer.

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

Commit messages:
 - Can only make assertions about reference strength for stores outside of the heap
 - Merge remote-tracking branch 'jdk/master' into satb-ignore-weak-store
 - Do not enqueue weak stores

Changes: https://git.openjdk.org/jdk/pull/24001/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24001&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8350905
  Stats: 7 lines in 1 file changed: 4 ins; 1 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/24001.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24001/head:pull/24001

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


More information about the hotspot-gc-dev mailing list