The JNI code uses GetPrimitiveArrayCritical() to get destination buffers for read_region() and read_associated_image(). This was presumably done to avoid an extra buffer copy, but the JNI documentation cautions that the *Critical methods should not be used for long-running operations.