public static void unmap(String resourceDescription, ByteBuffer buffer) throws IOException {
        if (!buffer.isDirect())
            throw new IllegalArgumentException("Unmapping only works with direct buffers");
        if (UNMAP == null)
            throw UNMAP_NOT_SUPPORTED_EXCEPTION;

        try {
            UNMAP.invokeExact(buffer);
        } catch (Throwable throwable) {
            throw new IOException("Unable to unmap the mapped buffer: " + resourceDescription, throwable);
        }
    }
Unmap the provided mapped or direct byte buffer.

This buffer cannot be referenced after this call, so it's highly recommended that any fields referencing it
should be set to null.

@throws IllegalArgumentException if buffer is not mapped or direct.
clients/src/main/java/org/apache/kafka/common/utils/ByteBufferUnmapper.java