Different types of DirectByteBuffer
All DirectByteBuffer
This category lists all DirectByteBuffer objects on the heap.
JVM-managed DirectByteBuffer
This category lists DirectByteBuffer objects managed by the JVM's built-in cleaner, jdk.internal.ref.Cleaner. These objects have a non-null DirectByteBuffer.cleaner field.
These objects manage a region of off-heap memory. When an object is no longer used, its associated cleaner automatically releases this memory.
JNI-allocated DirectByteBuffer
This category lists DirectByteBuffer objects that are allocated by the JNI method NewDirectByteBuffer and have null values for both the DirectByteBuffer.cleaner and DirectByteBuffer.att fields.
In this scenario, a user allocates memory using Unsafe or JNI and passes its address to the NewDirectByteBuffer JNI method. This binds the DirectByteBuffer object to the address, making the user responsible for managing the memory's lifecycle.