Deletes all the cached files since the last call to reset_used that have not been used.
553819
def purge():
    
    all_hashes = read_all()
    used_hashes = read_used()
    for kind, hashes in used_hashes.items():
        hashes = set(hashes)
        to_remove = set(all_hashes[kind]).difference(hashes)
        delete_from_directory_by_hashes(kind, to_remove)

    reset_used()
    write_out()
415901
public static void clear() {
		for (int i = 0; i < ByteBufPool.NUMBER_OF_SLABS; i++) {
			slabs[i].clear();
			created[i].set(0);
			reused[i].set(0);
		}
		synchronized (registry) {
			registry.clear();
		}
	}
417692
public function clearAllPersistentData ()
    {
        $filename = $this->config->get('file_directory').DIRECTORY_SEPARATOR.$this->config->get('file_name');
        unlink ($filename);
    }
1271462
public static void clearCaches()
    {
        synchronized (AbstractCache.CACHES) {
            for (final AbstractCache<?> cache : AbstractCache.CACHES) {
                cache.getCache4Id().clear();
                cache.getCache4Name().clear();
                cache.getCache4UUID().clear();
            }
        }
    }
1347117
void purge() {

        uncommittedCache.clear();

        try {
            if (cacheReadonly) {
                close(false);
            } else {
                if (dataFile != null) {
                    dataFile.close();

                    dataFile = null;
                }

                FileUtil.getDefaultInstance().delete(fileName);
            }
        } catch (Exception e) {
            throw Error.error(ErrorCode.FILE_IO_ERROR,
                              ErrorCode.M_TextCache_purging_file_error,
                              new Object[] {
                fileName, e
            });
        }
    }
320118
@ManagedOperation
    public void clear() {
        Set<K> keys=new HashSet<>(l2_cache.getInternalMap().keySet());
        mcastClear(keys, false);
    }
1170753
def clear(self):
        """"""
        with self.lock:
            for filehandle, refcount in list(self.files.items()):
                if refcount == 0:
                    filehandle.close()
                    del self.files[filehandle]
                    del self.past[self.past.index(filehandle)]
233888
private static synchronized void cleanup() {
		int cleanedDirs = 0;
		int cleanedFiles = 0;
		// retrieve leftover swap directories
		File[] swapDirs = TMP_DIR.listFiles(new FileFilter() {
			public boolean accept(File pathname) {
				return pathname.getName().endsWith(SWAP_DIR_SUFFIX);
			}
		});
		for(File swapDir : swapDirs) {
			// check if swap directory is locked
			File lockFile = new File(TMP_DIR, swapDir.getName() + LOCK_FILE_SUFFIX);
			if(lockFile.exists() == false) {
				// no lock file, recursively delete leftover swap dir
				cleanedDirs++;
				cleanedFiles += deleteRecursively(swapDir);
			}
		}
		System.out.println("NikeFS2: cleaned up " + cleanedFiles + 
				" stale swap files (from " + cleanedDirs + " sessions).");
	}
714484
public function clearCache()
    {
        $cachePath = $this->cachePath();

        if (!file_exists($cachePath)) {
            return;
        }

        $dir = new RecursiveDirectoryIterator($cachePath, RecursiveDirectoryIterator::SKIP_DOTS);
        $files = new RecursiveIteratorIterator($dir, RecursiveIteratorIterator::CHILD_FIRST);

        foreach($files as $file) {
            $path = $file->getRealPath();
            $file->isDir() ? rmdir($path) : unlink($path);
        }
        rmdir($cachePath);
    }
12281
public function clear()
    {
        $list = glob($this->cacheDir . '/*.*');
        if (empty($list)) return true;
        $all_deleted = true;
        foreach ($list as $path) {
            $deleted = unlink($path);
            if (!$deleted) {
                $all_deleted = false;
            }
        }
        return $all_deleted;
    }
1352261
def clear(self):
        
        self.log(u"Clearing cache...")
        for file_handler, file_info in self.cache.values():
            self.log([u"  Removing file '%s'", file_info])
            gf.delete_file(file_handler, file_info)
        self._initialize_cache()
        self.log(u"Clearing cache... done")
617153
public void clear() {
    ArrayList<Entry<K, V>> oldExclusives;
    ArrayList<Entry<K, V>> oldEntries;
    synchronized (this) {
      oldExclusives = mExclusiveEntries.clear();
      oldEntries = mCachedEntries.clear();
      makeOrphans(oldEntries);
    }
    maybeClose(oldEntries);
    maybeNotifyExclusiveEntryRemoval(oldExclusives);
    maybeUpdateCacheParams();
  }
609579
public void clearCache()
  {
    ZipFile zipFile = _zipFileRef.getAndSet(null);

    if (zipFile != null)
      try {
        zipFile.close();
      } catch (Exception e) {
      }
  }
295335
public function clear () : void
    {
        $storage = $this->locator->get(AssetStorage::class);
        $cache = $this->locator->get(AssetsCache::class);

        $storage->removeAllStoredFiles();
        $cache->clear();
    }
92199
protected function removeFiles()
    {
        $generator = $this->getFilenameOption();
        $pattern = $this->cacheDir . DIRECTORY_SEPARATOR . $generator('*');

        $objects = new GlobIterator($pattern);

        foreach ($objects as $object) {
            unlink($object);
        }
    }
530236
def clear_caches(self):
        
        for element_name in dir(self.components):
            element = getattr(self.components, element_name)
            if hasattr(element, 'cache_val'):
                delattr(element, 'cache_val')
596542
public void clearAllCaches() {
        logger.warn("beginning request to clear all caches");
        for (final String cacheName : this.cacheManager.getCacheNames()) {
            clearCache(cacheName);
        }
        logger.warn("completed request to clear all caches");
    }