-
Type:
Enhancement
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: 25
-
Component/s: hotspot
JNI Spec Chapter 4 says:
"Inside a “critical region” the native code should not run for an indefinite period of time, must not invoke arbitrary JNI functions, and must not perform operations that might cause the current thread to block and wait for another thread in the virtual machine. Given these restrictions, the virtual machine can temporarily disable garbage collection while giving the native code direct access to array elements."
Since JDK-8375188 shows a misuse can deadlock the GC, I think we really want to have -Xcheck:jni to preempt these cases with more checks.
"Inside a “critical region” the native code should not run for an indefinite period of time, must not invoke arbitrary JNI functions, and must not perform operations that might cause the current thread to block and wait for another thread in the virtual machine. Given these restrictions, the virtual machine can temporarily disable garbage collection while giving the native code direct access to array elements."
Since JDK-8375188 shows a misuse can deadlock the GC, I think we really want to have -Xcheck:jni to preempt these cases with more checks.
- relates to
-
JDK-8192647 GClocker induced GCs can starve threads requiring memory leading to OOME
-
- Resolved
-
-
JDK-8375188 Investigation: GC request deadlocks when holding a pinned object
-
- Open
-
- links to
-
Review(master)
openjdk/jdk/29206