RFR(XS): 6651256: 6651256: jstack: DeleteGlobalRef method call doesn't lead to descreasing of global refs count shown by jstack

Yumin Qi yumin.qi at oracle.com
Wed Jan 22 23:12:57 PST 2014


Please review this simple fix:

bug: https://bugs.openjdk.java.net/browse/JDK-6651256
webrev: http://cr.openjdk.java.net/~minqi/6651256/webrev00/

Summary: jni_DeleteGlobalRef does not really release the jni handle, 
instead, set the handle point to JNIHandles::_deleted_handle which holds 
an oop instance (java/lang/Object) in Java heap and never be GC'ed. When 
counting number of global reference, it counts all the handles on the 
chain list, which includes the already deleted ones. Fix by not counting 
those already deleted references.

Tests: JPRT, tmtools/jstack/jniglobalref/globalrefcount

Thanks
Yumin


More information about the hotspot-runtime-dev mailing list