title: Must ReleaseStringUTFChars be called after GetStringUTFChars (when passing the char* to C function)?
body: <p>I am a bit confused about the the objects which is passed to c from java? Should they be deleted inside the native jni method or they will be garbage collected when the method returns. For example: </p>
  
  <p>if I have a native declaration in my java file <code>public native printString(String msg);</code> and the native method is using <code>const char *message = (jni_env)-&gt;GetStringUTFChars(msg, &amp;iscopy);</code> to get c-style character array of string. <code>Shoud I call (jni_env)-&gt;ReleaseStringUTFChars(msg, message);</code> after doing all the stuff in native method. If yes, then why it is necessary? Why not java runtime environment be doing this on the behalf of programmer? After all the string was declared and passed from java environment.</p>