How do you use NewDirectByteBuffer?
When you allocate a DirectByteBuffer from the Java side, I assume the memory will be freed by the VM via a finalizer on the Java DirectByteBuffer object.
How is this supposed to work when using the JNI method NewDirectByteBuffer from native code to create the DirectByteBuffer object? What happens when the DirectByteBuffer object is collected? How do we handle freeing the memory block on the C heap?