public int validateAndDetermineArenaSize(int arenaCount, long maxSizeVal) {
    long arenaSizeVal = (arenaCount == 0) ? MAX_ARENA_SIZE : maxSizeVal / arenaCount;
    // The math.min, and the fact that maxAllocation is an int, ensures we don't overflow.
    arenaSizeVal = Math.max(maxAllocation, Math.min(arenaSizeVal, MAX_ARENA_SIZE));
    if (LlapIoImpl.LOG.isInfoEnabled()) {
      LlapIoImpl.LOG.info("Buddy allocator with " + (isDirect ? "direct" : "byte") + " buffers; "
          + (isMapped ? ("memory mapped off " + cacheDir.toString() + "; ") : "")
          + "allocation sizes " + minAllocation + " - " + maxAllocation
          + ", arena size " + arenaSizeVal + ", total size " + maxSizeVal);
    }

    String minName = ConfVars.LLAP_ALLOCATOR_MIN_ALLOC.varname,
        maxName = ConfVars.LLAP_ALLOCATOR_MAX_ALLOC.varname;
    if (minAllocation < 8) {
      throw new RuntimeException(minName + " must be at least 8 bytes: " + minAllocation);
    }
    if (maxSizeVal < maxAllocation || maxAllocation < minAllocation) {
      throw new RuntimeException("Inconsistent sizes; expecting " + minName + " <= " + maxName
          + " <= " + ConfVars.LLAP_IO_MEMORY_MAX_SIZE.varname + "; configured with min="
          + minAllocation + ", max=" + maxAllocation + " and total=" + maxSizeVal);
    }
    if ((Integer.bitCount(minAllocation) != 1) || (Integer.bitCount(maxAllocation) != 1)) {
      throw new RuntimeException("Allocation sizes must be powers of two; configured with "
          + minName + "=" + minAllocation + ", " + maxName + "=" + maxAllocation);
    }
    if ((arenaSizeVal % maxAllocation) > 0) {
      long oldArenaSize = arenaSizeVal;
      arenaSizeVal = (arenaSizeVal / maxAllocation) * maxAllocation;
      LlapIoImpl.LOG.warn("Rounding arena size to " + arenaSizeVal + " from " + oldArenaSize
          + " to be divisible by allocation size " + maxAllocation);
    }
    return (int)arenaSizeVal;
  }
Default max amount of bytes to force evict on failed allocation attempts 16MB. used for testing, for production
please adjust {@link ConfVars.LLAP_ALLOCATOR_MAX_FORCE_EVICTED}
llap-server/src/java/org/apache/hadoop/hive/llap/cache/BuddyAllocator.java