RFR (sh/jdk8): Cleanup weak JNI refs when not doing reference processing
Zhengyu Gu
zgu at redhat.com
Fri Dec 13 15:23:49 UTC 2019
On 12/13/19 9:05 AM, Roman Kennke wrote:
> System dict and string table are done while doing unloading in
> parallelCleaning.hpp. Not sure about JVMTI. JNI weakroots popped up
> because they are hidden in reference-processing.
Okay.
In JDK8u, string table is handled in parallel_cleaning, and JvmtiExport
weak root is folded into JNIHandles.
It is good to go.
Thanks,
-Zhengyu
>
> Roman
>
>> 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