The advantage of using JNI is that both the calling program and the called program are executed in the same process (task), while other methods start a new process (task). This makes JNI faster at startup and less resource intensive. However, since Java applications run in a technology-independent machine interface (TIMI), and native user methods require the user address space to run, first a preload is required to create a user environment that uses 16-byte address pointers instead of 8-byte pointers used below TIMI. It just means that your reasons for using JNI should be based on more performance.
source share