|  | Level: Introductory Mark Bluemel (dwinfo@us.ibm.com), Software engineer, IBM Hursley Lab
15 Jan 2002 JNI programmers who use Get* calls (for example, GetStringCritical) must always use the corresponding Release* call (for example, ReleaseStringCritical) when they have finished with the data -- even if the isCopy parameter indicates that no copy was taken.
The Get* calls must guarantee that the pointer returned remains valid until Release* is called, so the JVM will either hold additional copies of the data or "pin" the data, so it can neither be garbage collected nor moved during heap compaction. This will cause subsequent heap problems.
Use -Xcheck:jni, which enables argument checking for JNI interface routines. By default, no "sanity-checking" of JNI arguments is done.
About the author  | |  | Mark Bluemel is a software engineer at the IBM Hursley Lab.
|
Rate this page
|  |
|