private ByteBuffer preallocateArenaBuffer(int arenaSize) throws ClosedByInterruptException {
    if (isMapped) {
      RandomAccessFile rwf = null;
      File rf = null;
      Preconditions.checkArgument(isDirect, "All memory mapped allocations have to be direct buffers");
      try {
        rf = File.createTempFile("arena-", ".cache", cacheDir.toFile());
        rwf = new RandomAccessFile(rf, "rw");
        rwf.setLength(arenaSize); // truncate (TODO: posix_fallocate?)
        // Use RW, not PRIVATE because the copy-on-write is irrelevant for a deleted file
        // see discussion in YARN-5551 for the memory accounting discussion
        return rwf.getChannel().map(MapMode.READ_WRITE, 0, arenaSize);
      } catch (ClosedByInterruptException cbi) {
        LlapIoImpl.LOG.warn("Interrupted while trying to allocate memory mapped arena", cbi);
        // finally may not execute on thread interrupts so cleanup the arena file as it may be unmapped
        IOUtils.closeQuietly(rwf);
        if (rf != null) {
          rf.delete();
          rf = null;
        }
        throw cbi;
      } catch (IOException ioe) {
        LlapIoImpl.LOG.warn("Failed trying to allocate memory mapped arena", ioe);
        // fail similarly when memory allocations fail
        throw new OutOfMemoryError("Failed trying to allocate memory mapped arena: " + ioe.getMessage());
      } finally {
        // A mapping, once established, is not dependent upon the file channel that was used to
        // create it. delete file and hold onto the map
        IOUtils.closeQuietly(rwf);
        if (rf != null) {
          rf.delete();
        }
      }
    }
    return isDirect ? ByteBuffer.allocateDirect(arenaSize) : ByteBuffer.allocate(arenaSize);
  }
Quite similar as deallocateEvicted, however since this request was not originated from a reserveMemory call,
MM state has to be maintained here.
@param buffer
llap-server/src/java/org/apache/hadoop/hive/llap/cache/BuddyAllocator.java