- 
    Enhancement 
- 
    Resolution: Fixed
- 
     P3 P3
- 
    10
An earlier prototype uncovers an issue related to JNI_FindClass that is called during JNI_OnUnload that resurrects the caller class which has been GC'ed.
I think JNI FindClass should not be called during JNI_OnUnload [1]. This would require further investigation, for example, whether it's possible to prohibit JNI_FindClass is called during JNI_OnUnload (to avoid resurrecting the caller's class). Also might be useful to gather some data to determine how high the compatibility risk is for JNI_FindClass not to work in JNI_OnUnload.
1] https://bugs.openjdk.java.net/browse/JDK-4240589?focusedCommentId=13474512&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13474512
- csr for
- 
                    JDK-8187882 Replace ClassLoader use of finalizer with phantom reference to unload native library -           
- Closed
 
-         
- duplicates
- 
                    JDK-6219879 (cl) ClassLoader.NativeLibrary.load should be consistent in initialization of handleID -           
- Closed
 
-         
- is blocked by
- 
                    JDK-8188052 JNI FindClass needs to specify the class loading context used for library lifecycle hooks -           
- Resolved
 
-         
- relates to
- 
                    JDK-8191360 Lookup of critical JNI method causes duplicate library loading with leaking handler -           
- Resolved
 
-         
- 
                    JDK-5086661 JDK 1.5's temporary native libraries may not be deleted on VM exit -           
- Closed
 
-         
- 
                    JDK-8160704 JVM crash once unloading libraries -           
- Closed
 
-         
- 
                    JDK-8253568 Replace and mitigate Object.finalize() uses in JDK libraries -           
- Open
 
-