I need to do garbage collection in JNI. Please clarify me the following points.
I assume these concepts are correct upto the knowledge that I had gained from the books that I read.
I am going to implement in our project all these concepts. So, I thought of getting opinion from you people.
I do C to Java communication ( With C creating the JVM and executes Java methods )
I do know that global reference will keep the object from being garbage collected across many JNI calls. i.e. JVM wont gc this object unless we explicitly delete the global reference.
Please validate this.
An object is created as a local reference.
Do I need delete it in order to allow gcollector to swallow this object.
During core dump, can I give the function call to do safe shutdown, in order to avoid dangerous loss of data. i.e. like closing certain
The methodIDs, fieldIDs are not changed on a particular machine unless I do change anything in the Java side.
Any string obtained using GetStringUTFChars() has to be followed by ReleaseStringUTF().
Please add any more points.
My C program is going to run like a Demon.
Can I use threading in Java.
Or it is better to implement threads in C?
Please suggest any online material for JNI that can be downloadable.