A mistake in Java code usually ends in an exception you can catch and read. A mistake in JNI code usually does not: a reference used after it expired, or on the wrong thread, takes down the entire JVM with a crash report, while a reference that is never released leaks memory slowly until the …