@Override
  public boolean allocateUntilAvailable(long sizeInByte, long retryIntervalInMillis)
      throws InterruptedException {
    long originSize = usedMemoryInBytes.get();
    while (true) {
      boolean canUpdate = originSize + sizeInByte <= totalMemorySizeInBytes;
      if (canUpdate && usedMemoryInBytes.compareAndSet(originSize, originSize + sizeInByte)) {
        break;
      }
      Thread.sleep(TimeUnit.MILLISECONDS.toMillis(retryIntervalInMillis));
      originSize = usedMemoryInBytes.get();
    }
    return true;
  }
The memory usage in byte of this memory block
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/memory/AtomicLongMemoryBlock.java