high memory usage there. We should really only use this function to search
for a small number of files. Larger numbers of files should use a different
algorithm that will ensure that each CONTENTS file is only parsed once.
import codecs
from collections import deque
+import gc
import re, shutil, stat, errno, copy, subprocess
import logging
import os as _os
if len(dblink_fifo) >= 100:
# Ensure that we don't run out of memory.
del dblink_cache[dblink_fifo.popleft().mycpv]
+ gc.collect()
x = self._vardb._dblink(cpv)
dblink_cache[cpv] = x
dblink_fifo.append(x)