B
Bryan Castillo
I'm getting a StackOverflow exception while using JNI.
I have a loop written in C/JNI which calls back a Java object (which
conforms to some interface). The loop is creating 2 byte arrays and
giving them to the object being called back. The arrays are being
created with the function NewByteArray. For some reason around 50,000
items into the iteration, I run into a StackOverflow exception. I'm
not actually doing anything with the byte arrays once passing to the
callback. (In the JNI code the byte arrays are not returned). Should I
be deleting them using DeleteLocalRef? (I'll try tomorrow - forgot to
bring the code home with me).
[side question]
Is the array returned from NewByteArray a local reference or global?
I thought it was a local reference. But if that is true should you
use NewGlobalRef before returning the byte array back to java code?
Currently, im just returning the jbyteArray and everything seems to be
working so far.
thanks.
I have a loop written in C/JNI which calls back a Java object (which
conforms to some interface). The loop is creating 2 byte arrays and
giving them to the object being called back. The arrays are being
created with the function NewByteArray. For some reason around 50,000
items into the iteration, I run into a StackOverflow exception. I'm
not actually doing anything with the byte arrays once passing to the
callback. (In the JNI code the byte arrays are not returned). Should I
be deleting them using DeleteLocalRef? (I'll try tomorrow - forgot to
bring the code home with me).
[side question]
Is the array returned from NewByteArray a local reference or global?
I thought it was a local reference. But if that is true should you
use NewGlobalRef before returning the byte array back to java code?
Currently, im just returning the jbyteArray and everything seems to be
working so far.
thanks.