S
Sheol
Why does the GC not collect the local references created in my shared
library? How do I get these objects to collect so that I do not have a
memory leak?
JVM: Sun's 1.5.0_06 for linux.
I have a shared library that I am using behind other larger
(behemoth) programs to start a JVM and execute an existing, complex
system. I use the JNI_CreateJavaVM() to create the JVM using
JNI_VERSION_1_4 arguments. It starts without errors and I am able to use
the existing system for some number of calls. The argument list in the
interface between the shared library and the java system requires that the
shared library create objects and fill them. However, the GC will never
claim the objects created in the shared library through the JNI even
though they show up in a GC root (I have been using a profiler to help
with this). I have used PushLocalFrame()/PopLocalFrame() and
DeleteLocalRef() with no affect. So, why does the GC not collect the local
references created through the JNI? How do I get these objects to
collect so that I do not have a memory leak?
I have an incredibly small test suite that I could post for people if they
want to help find and fix this problem.
I will monitor this posting so please do not send email -- besides, I
think this address is dead anyway.
I have done the obligatory search on google, read Sun's JNI tutorial
(mildly instructive), read a good deal of the JNI specification (more
instructive than the tutorial), and read about as much as I can find on
this topic (including some book whose title I forgot already). That does
not mean I have read everything, just as much as I found.
Lastly, thanks in advance for any and all help.
library? How do I get these objects to collect so that I do not have a
memory leak?
JVM: Sun's 1.5.0_06 for linux.
I have a shared library that I am using behind other larger
(behemoth) programs to start a JVM and execute an existing, complex
system. I use the JNI_CreateJavaVM() to create the JVM using
JNI_VERSION_1_4 arguments. It starts without errors and I am able to use
the existing system for some number of calls. The argument list in the
interface between the shared library and the java system requires that the
shared library create objects and fill them. However, the GC will never
claim the objects created in the shared library through the JNI even
though they show up in a GC root (I have been using a profiler to help
with this). I have used PushLocalFrame()/PopLocalFrame() and
DeleteLocalRef() with no affect. So, why does the GC not collect the local
references created through the JNI? How do I get these objects to
collect so that I do not have a memory leak?
I have an incredibly small test suite that I could post for people if they
want to help find and fix this problem.
I will monitor this posting so please do not send email -- besides, I
think this address is dead anyway.
I have done the obligatory search on google, read Sun's JNI tutorial
(mildly instructive), read a good deal of the JNI specification (more
instructive than the tutorial), and read about as much as I can find on
this topic (including some book whose title I forgot already). That does
not mean I have read everything, just as much as I found.
Lastly, thanks in advance for any and all help.