コード例 #1
0
ファイル: OMMapManager.java プロジェクト: cloudsmith/orientdb
  /** Frees the mmap entry from the memory */
  private static boolean removeEntry(
      final Iterator<OMMapBufferEntry> it, final OMMapBufferEntry entry) {
    if (commitBuffer(entry)) {
      // COMMITTED: REMOVE IT
      it.remove();
      final List<OMMapBufferEntry> file = bufferPoolPerFile.get(entry.file);
      if (file != null) {
        file.remove(entry);
        if (file.isEmpty()) bufferPoolPerFile.remove(entry.file);
      }
      entry.buffer = null;

      totalMemory -= entry.size;
      return true;
    }
    return false;
  }