RFR: 8350905: Shenandoah: Releasing a WeakHandle's referent may extend its lifetime [v2]
William Kemper
wkemper at openjdk.org
Wed Mar 12 20:45:08 UTC 2025
On Wed, 12 Mar 2025 18:55:08 GMT, William Kemper <wkemper at openjdk.org> wrote:
>> 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.
>
> William Kemper has updated the pull request incrementally with two additional commits since the last revision:
>
> - Split out and comment on weak/phantom stores separately
> - Revert unnecessary change
I don't see any performance difference on Specjbb. The issue there is with getting cleared weak references processed by the Java thread that queues the weak references. References processing also uses `RawAccess` to null out the referent, so it doesn't go through this barrier.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24001#issuecomment-2719079655
More information about the shenandoah-dev
mailing list