Flush out all modified objects to disk and shrink the in-memory list if
 needed.
320514
def sync
      if @cache.in_transaction?
        @cache.abort_transaction
        @cache.flush
        PEROBS.log.fatal "You cannot call sync() during a transaction: \n" +
          Kernel.caller.join("\n")
      end
      @cache.flush
    end
1082965
public void clearMemoryCaches() {
    Predicate<CacheKey> allPredicate =
        new Predicate<CacheKey>() {
          @Override
          public boolean apply(CacheKey key) {
            return true;
          }
        };
    mBitmapMemoryCache.removeAll(allPredicate);
    mEncodedMemoryCache.removeAll(allPredicate);
  }
543723
function shrinkList(list, newSize) {
    var size = list.length;
    list.length = newSize;

    if (size < newSize) {
        do {
            delete list[newSize];
        }
        while (newSize-- < size);
    }
}
1129170
def _cleanup(self):  # pragma: no cover
        
        need_to_delete = []  # can't delete from a dict while iterating
        with self.attr_lock:
            now_time = time()
            for path in self.cache:
                if now_time - self.attr[path][TIMESTAMP_KEY] >= MAX_CACHE_TIME:
                    need_to_delete.append(path)
            for path in need_to_delete:
                del self.attr[path]
                del self.cache[path]
688774
def flush(self):
        
        annotation = self.get_annotation()
        if annotation.get(ATTACHMENTS_STORAGE) is not None:
            del annotation[ATTACHMENTS_STORAGE]
283243
def flush(self):
        """"""
        for name in self.item_names:
            item = self[name]
            item.flush()
        self.file.flush()
72294
@Override
    public void clear() {
        if (mSize != 0) {
            freeArrays(mHashes, mArray, mSize);
            mHashes = ContainerHelpers.EMPTY_INTS;
            mArray = ContainerHelpers.EMPTY_OBJECTS;
            mSize = 0;
        }
    }
910375
def flush(self, batch_size=1000):
        
        keys = self.database.keys(self.namespace + ':*')
        for i in range(0, len(keys), batch_size):
            self.database.delete(*keys[i:i + batch_size])
739515
public void clear ()
    {
        for (int icount = _items.size(); icount > 0; icount--) {
            DirtyItem item = _items.remove(0);
            item.clear();
            _freelist.add(item);
        }
    }
222885
private synchronized void clean() {
		
		while (checkOverFlow()) {

			List<CacheObject> cacheObjectList = sort();

			if (cacheObjectList != null && cacheObjectList.size() > 0) {
				CacheObject cacheObject = (CacheObject) cacheObjectList.get(0);
				remove(cacheObject.getKey());
			}
		}
	}
1278759
public void clear() {
        if (mSize != 0) {
            freeArrays(mHashes, mArray, mSize);
            mHashes = EMPTY_INTS;
            mArray = EMPTY_OBJECTS;
            mSize = 0;
        }
    }
1202415
def flush(self):
        """"""
        now = time.time()
        to_remove = []
        for k, entry in self.pool.items():
            if entry.timestamp < now:
                entry.client.close()
                to_remove.append(k)
        for k in to_remove:
            del self.pool[k]
809034
def flush(self):
        """"""
        keys = self.client.smembers(self.keys_container)
        for key in keys:
            self.delete_entry(key)
663689
def cleanup(self):
        
        remove = []
        for handle, assoc in self.assocs.iteritems():
            if assoc.getExpiresIn() == 0:
                remove.append(handle)
        for handle in remove:
            del self.assocs[handle]
        return len(remove), len(self.assocs)
336388
def flush(self):
        """"""
        keys = list(self.keys())
        if keys:
            return self.database.delete(*keys)
1208320
def __cleanup(self):
        
# TODO: Test this.
        with self.__class__.__locker:

            while self.__read_buffer_index > 0:
                del self.__buffers[0]
                self.__read_buffer_index -= 1
39874
def purge(self):
        '''
        
        '''
        for table_name in self._db.list_tables():
            self._db.flush(table_name)

        self._run_init_queries()