RFR: Missing JNI Weak Refs handling after JDK-8189359
Aleksey Shipilev
shade at redhat.com
Wed Feb 7 11:07:05 UTC 2018
http://cr.openjdk.java.net/~shade/shenandoah/weakjni-process/webrev.01/
sh/jdk10 had regressed JNI Weak Refs after we accepted JDK-8189359 [1] from upstream. This seems to
be the cause of the failure Lennart sees here:
http://mail.openjdk.java.net/pipermail/shenandoah-dev/2018-February/004883.html
The failure goes like this. With concurrent mark that processes references, we skip marking weak
references, which includes JNI Weak Refs. At final mark, we would go to reference processor which is
supposed to complete the mark, including JNI Weak Refs. That is, it used to do that, until
JDK-8189369 moved it out of ReferenceProcessor.
The fix is to call the same new WeakProcessor other GCs are calling now. It seems to require
mechanically changing JNIHandles::weak_oops_do to WeakProcessor::oops_do, and calling
WeakProcessor::weak_oops_do in the same context where we process references.
Testing: hotspot_gc_shenandoah, new test
Thanks,
-Aleksey
[1] "Move native weak oops cleaning out of ReferenceProcessor"
https://bugs.openjdk.java.net/browse/JDK-8189359
More information about the shenandoah-dev
mailing list