This purge all the object expired or objects that can be purged
772110
public void purge() {
		long startTime=System.currentTimeMillis();
		long objectPurged=0;
		
		Set<Map.Entry<String, T>> set=map.entrySet();
		
		long time=System.currentTimeMillis()-minUnactiveTime;
		
		for (Iterator<Map.Entry<String, T>> i=set.iterator();i.hasNext();){
			Map.Entry<String, T> entry=i.next();
			T object=entry.getValue();
			
			// Check if the object has to be removed from the cache
			if (object.getLastAccess()<time && object.canPurge() ){
				i.remove();
				objectPurged++;
			}
		}
		
		if (log.isInfoEnabled()){
			if (objectPurged==0){
				if (log.isDebugEnabled()){
					log.info("Cache:"+name+
							 " Purged:"+objectPurged+
							 " Time:"+(System.currentTimeMillis()-startTime));
				}
			} else {
				log.info("Cache:"+name+
						 " Purged:"+objectPurged+
						 " Time:"+(System.currentTimeMillis()-startTime));
			}
		}
		
	}
844456
public function purge() {
        // Get all files from the cache folder
        $contents = glob($this->_storage_path . '*');

        // Remove cache files
        foreach ($contents as $content) {
            if (is_file($content)) {
                unlink($content);
            }
        }
    }
63935
def cache_clean(self):
		
		now = time.time()
		keys_for_removal = collections.deque()
		for key, (_, expiration) in self.__cache.items():
			if expiration < now:
				keys_for_removal.append(key)
		for key in keys_for_removal:
			del self.__cache[key]
158638
def __purge():
    
    global __receivers
    newreceivers = collections.defaultdict(list)

    for signal, receivers in six.iteritems(__receivers):
        alive = [x for x in receivers if not __is_dead(x)]
        newreceivers[signal] = alive

    __receivers = newreceivers
1214137
private void purgeAllConnections() {
        synchronized (m_dbConns) {
            Iterator<DBConn> iter = m_dbConns.iterator();
            while (iter.hasNext()) {
                DBConn dbConn = iter.next();
                dbConn.close();
                iter.remove();
            }
        }
    }
62415
protected void flushObjects ()
    {
        long now = System.currentTimeMillis();
        for (Iterator<IntMap.IntEntry<FlushRecord>> iter = _flushes.intEntrySet().iterator();
             iter.hasNext(); ) {
            IntMap.IntEntry<FlushRecord> entry = iter.next();
//             int oid = entry.getIntKey();
            FlushRecord rec = entry.getValue();
            if (rec.expire <= now) {
                iter.remove();
                flushObject(rec.object);
//                 Log.info("Flushed object " + oid + ".");
            }
        }
    }
755820
def purge_all(delete=False, verbosity=0):
    """"""
    _location_purge_all(delete, verbosity)
    _storage_purge_all(delete, verbosity)
1285120
def purge(context, resource, **kwargs):
    """"""
    uri = '%s/%s/purge' % (context.dci_cs_api, resource)
    if 'force' in kwargs and kwargs['force']:
        r = context.session.post(uri, timeout=HTTP_TIMEOUT)
    else:
        r = context.session.get(uri, timeout=HTTP_TIMEOUT)
    return r
573477
def cleanup(self):
        
        now = time.time()
        expired = now - NODE_TIMEOUT
        if self.conn.zremrangebyscore(self.key, 0, expired):
            self._notify()
318923
private void purge()
  {
    if (TraceComponent.isAnyTracingEnabled() && _tc.isEntryEnabled()) SibTr.entry(this, _tc, "purge");

    Iterator<Map.Entry<K,TimedValue<V>>> it = _realMap.entrySet().iterator();
    while (it.hasNext())
    {
      Map.Entry<K,TimedValue<V>> entry = it.next();
      TimedValue<V> value = entry.getValue();
      if (value.hasExipred())
      {
        it.remove();
        if (TraceComponent.isAnyTracingEnabled() && _tc.isDebugEnabled())
        {
          SibTr.debug(_tc, "The value with the key " + entry.getKey() + " has expired");
        }
      }
    }
    
    if (TraceComponent.isAnyTracingEnabled() && _tc.isEntryEnabled()) SibTr.exit(this, _tc, "purge");
  }
692797
def clear_all_expired()
      t = Time.now
      return if t < @next_expiration && ! @cache.any? {|name, _| @cache_expiration_service.expired?(name.to_sym) }
      to_expire = @cache.select { |name, entry| entry.expires < t || @cache_expiration_service.expired?(name.to_sym) }
      to_expire.each do |name, entry|
        Puppet.debug {"Evicting cache entry for environment '#{name}'"}
        @cache_expiration_service.evicted(name)
        clear(name)
        @expirations.delete(entry.expires)
        Puppet.settings.clear_environment_settings(name)
      end
      @next_expiration = @expirations.first || END_OF_TIME
    end
243462
public long cleanup() {
		int garbageSize = 0;
		if (isCachingEnabled()) {
			System.out.println(new LogEntry(Level.VERBOSE, "Identifying expired objects"));
			ArrayList<K> garbage = getExpiredObjects();
			garbageSize = garbage.size();
			System.out.println(new LogEntry("cache cleanup: expired objects: " + garbageSize));
			for (K key : garbage) {
				clear(key);
			}
		}
		return garbageSize;
	}
295999
def _purge_expired(self):
        
        time_horizon = time.time() - self._keep_time
        new_cache = {}
        for (k, v) in self._cache.items():
            if v.timestamp > time_horizon:
                new_cache[k] = v
        self._cache = new_cache
115100
def _purge_expired(self):
        
        time_horizon = time.time() - self._keep_time
        new_cache = {}
        dec_count_for = []
        for (k, v) in self._cache.items():
            if v.count > 0:
                if k not in self._block_store:
                    new_cache[k] = v
                else:
                    if v.timestamp > time_horizon:
                        new_cache[k] = v
                    else:
                        block = v.value
                        if block is not None:
                            dec_count_for.append(block.previous_block_id)

            elif v.timestamp > time_horizon:
                new_cache[k] = v

            else:
                block = v.value
                # Handle NULL_BLOCK_IDENTIFIER
                if block is not None:
                    dec_count_for.append(block.previous_block_id)

        self._cache = new_cache
        for block_id in dec_count_for:
            if block_id in self._cache:
                self._cache[block_id].dec_count()
255555
def cleanup_full_hashes(self, keep_expired_for=(60 * 60 * 12)):
        """"""
        q = '''DELETE FROM full_hash WHERE expires_at < datetime(current_timestamp, '-{} SECONDS')
        '''
        log.info('Cleaning up full_hash entries expired more than {} seconds ago.'.format(keep_expired_for))
        with self.get_cursor() as dbc:
            dbc.execute(q.format(int(keep_expired_for)))
204723
public function purgeExpired()
    {

        if ($this->sqlInitialized()) {
            if ($this->sql) {
                if ($this->sql->query("
                    DELETE
                        FROM `{$this->table}`
                        WHERE `expire` < NOW()
                ")) {
                    return true;
                }
            }
        }
        return false;
    }
513083
public void disposeAll() {
        for( WeakReference<Com4jObject> ref : objects) {
        	Com4jObject o = ref.get();
        	if(o != null) {
        		o.dispose();
        	}
        }
        objects.clear();
    }