RFR (sh/jdk8): Cleanup weak JNI refs when not doing reference processing

Zhengyu Gu zgu at redhat.com
Fri Dec 13 13:57:09 UTC 2019


Hi Roman,

On 12/13/19 8:34 AM, Roman Kennke wrote:
> We may run into troubles in jdk8 when doing class-unloading but not 
> reference-processing: in JDK8, ref-processing also handles JNI weak-refs 
> (it doesn't really belong there, which is why it has been moved out in 
> later releases). This means that when we have a cycle that doesn't do 
> ref-processing, we may skip cleaning JNI refs and end up with dangling 
> refs there. This manifests easily when running IntelliJ.
> 
> Fix is to clean JNI weak-refs explicitely when skipping ref-processing.
> 

Looks like we missed more than just JNI weak root, but whole 
weak_roots_work() equivalency in sh/jdk11u, which includes jvmti and 
system dictionary roots, etc.


-Zhengyu


> Fix:
> http://cr.openjdk.java.net/~rkennke/shjdk8-cleanup-weakjni/webrev.00/
> 
> Testing: hotspot_gc_shenandoah
> IntelliJ with default and traversal mode (failed before/passes now)
> 
> Good?
> 
> Thanks,
> Roman
> 



More information about the shenandoah-dev mailing list