
Chapter 6. Java Native Interface (JNI) 93
6.1.3 JNI and the Garbage Collector
The Garbage Collector reclaims garbage. And in the case of JNI, there is a
so-called local reference in the stack of the thread that points to an object in the
JVM Heap. Figure 6-4 illustrates a thread stack pointing to an object in the JVM.
Local references are automatically created and deleted.
Figure 6-4 Thread stack pointing to an object in the JVM heap
6.2 Getting started with a JNI application
You may encounter a situation where you need to use the Java Native Interface
(JNI), because no Java functions are available to access the required resource. A
native program ...