void flushBuffers() {
    pagesAllocationLock.lock();
    try {
      pagesAccessLock.lock();
      try {
        while (!pagesByPageId.isEmpty()) {
          pagesByPageId.doRemoveEldestEntry();
        }
      }
      finally {
        pagesAccessLock.unlock();
      }

      disposeRemovedSegments(null);
    }
    finally {
      pagesAllocationLock.unlock();
    }
  }
void flushBuffers()