Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Who releases the NewObjectArray

843829Aug 13 2003 — edited Aug 13 2003
Hi All
I'm passing an array from C to Java. (check pseudo in following code snippet)
JNI_METHOD(jenv, jobj, jlong arraySize, jobjectArray jArry)
{
arraySize = 10
jArry = jenv->NewObjectArray
}
Won't calling this method cause a memory leak since there is no place where we could release/delete the created object array .

Is it really so? any comments , guidence
TIA

PS: I suppose that even jlong (primitive type) parameters are pssed by reference (in JNI calls) so if I change value of some jlong in C, it will be reflected in calling java code. A little testing would reveal the fact. But can some body tell me the role/logic which governs the behavior?

Asim Hussnain , IPA


Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 10 2003
Added on Aug 13 2003
4 comments
825 views