code: public static void unmap(ByteBuffer buf) {
          try {
              UNMAPPER.ifPresent(u -> u.accept(buf));
          } catch (Exception e) {
              LOG.error("Unable to unmap ByteBuffer.", e);
          }
      }
docs: Unmap memory mapped byte buffers. This is a hack waiting for a proper JVM provided solution expected in java 10 https://bugs.openjdk.java.net/browse/JDK-4724038 The issue
  here is that even when closed, memory mapped byte buffers hold a lock on the underlying file until GC is executed and this in turns result in an error if the user tries to
  move or delete the file.
  
  @param buf