RFR (XXXS): 8193234: When using -Xcheck:jni an internally allocated buffer can leak

David Holmes david.holmes at oracle.com
Thu Feb 7 10:13:15 UTC 2019


bug: https://bugs.openjdk.java.net/browse/JDK-8193234
webrev: http://cr.openjdk.java.net/~dholmes/8193234/webrev

Full details in bug report but basically with the use of GuardedMemory 
in the checked versions of the *ArrayCritical functions we always have 
to release the GuardedMemory copy.

I wrote a test that can be used to demonstrate the memory leak using top 
to see the VIRT and RES memory use on linux. That test can be seen here:

http://cr.openjdk.java.net/~dholmes/8193234/webrev.withtest/

but the test is not a regression test and so is not committed.

Token testing:
   - runtime/jni

but no existing tests use the JNI_COMMIT mode anyway and that is the 
only mode affected by this change.

Thanks,
David


More information about the hotspot-runtime-dev mailing list