Memory management while implementing JNI interfaces.
999713Mar 28 2013 — edited Mar 28 2013The assumption here is that java code calls a C function from a
shared library in Linux.
How should memory management be done in the native code called
from Java using a JNI interface?
What role does the Garbage Collector play in handling memory that
was allocated in the native C code?
If I allocate memory using malloc() in the C program, should I
explicitly free it? Will the GC take care of it?
Does anyone have an idea of how memory management be done while
implementing a JNI interface?
Thanks,
Nisahnt