diff -urN synapse/util/caches/descriptors.py /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/descriptors.py --- synapse/util/caches/descriptors.py 2016-02-13 12:48:45.514736907 +0100 +++ /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/descriptors.py 2016-02-15 12:55:01.153097787 +0100 @@ -40,7 +40,8 @@ class Cache(object): - def __init__(self, name, max_entries=1000, keylen=1, lru=True, tree=False): + def __init__(self, name, max_entries=50, keylen=1, lru=True, tree=False): + max_entries = 5 if lru: cache_type = TreeCache if tree else dict self.cache = LruCache( @@ -138,7 +139,7 @@ which can be used to insert values into the cache specifically, without calling the calculation function. """ - def __init__(self, orig, max_entries=1000, num_args=1, lru=True, tree=False, + def __init__(self, orig, max_entries=50, num_args=1, lru=True, tree=False, inlineCallbacks=False): self.orig = orig @@ -343,7 +344,7 @@ return wrapped -def cached(max_entries=1000, num_args=1, lru=True, tree=False): +def cached(max_entries=50, num_args=1, lru=True, tree=False): return lambda orig: CacheDescriptor( orig, max_entries=max_entries, @@ -353,7 +354,7 @@ ) -def cachedInlineCallbacks(max_entries=1000, num_args=1, lru=False, tree=False): +def cachedInlineCallbacks(max_entries=50, num_args=1, lru=False, tree=False): return lambda orig: CacheDescriptor( orig, max_entries=max_entries, Binary files synapse/util/caches/descriptors.pyc and /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/descriptors.pyc differ diff -urN synapse/util/caches/dictionary_cache.py /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/dictionary_cache.py --- synapse/util/caches/dictionary_cache.py 2016-02-13 12:48:45.514736907 +0100 +++ /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/dictionary_cache.py 2016-02-15 12:55:09.165064478 +0100 @@ -31,7 +31,8 @@ fetching a subset of dictionary keys for a particular key. """ - def __init__(self, name, max_entries=1000): + def __init__(self, name, max_entries=50): + max_entries = 5 self.cache = LruCache(max_size=max_entries) self.name = name Binary files synapse/util/caches/dictionary_cache.pyc and /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/dictionary_cache.pyc differ diff -urN synapse/util/caches/expiringcache.py /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/expiringcache.py --- synapse/util/caches/expiringcache.py 2016-02-13 12:48:45.514736907 +0100 +++ /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/expiringcache.py 2016-02-15 12:55:25.948994696 +0100 @@ -36,6 +36,7 @@ an item on access. Defaults to False. """ + max_len = 5 self._cache_name = cache_name self._clock = clock Binary files synapse/util/caches/expiringcache.pyc and /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/expiringcache.pyc differ Binary files synapse/util/caches/__init__.pyc and /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/__init__.pyc differ diff -urN synapse/util/caches/lrucache.py /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/lrucache.py --- synapse/util/caches/lrucache.py 2016-02-13 12:48:45.514736907 +0100 +++ /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/lrucache.py 2016-02-15 12:55:39.392938797 +0100 @@ -36,6 +36,7 @@ If cache_type=TreeCache, all keys must be tuples. """ def __init__(self, max_size, keylen=1, cache_type=dict): + max_size = 5 cache = cache_type() self.cache = cache # Used for introspection. list_root = [] Binary files synapse/util/caches/lrucache.pyc and /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/lrucache.pyc differ Binary files synapse/util/caches/snapshot_cache.pyc and /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/snapshot_cache.pyc differ diff -urN synapse/util/caches/stream_change_cache.py /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/stream_change_cache.py --- synapse/util/caches/stream_change_cache.py 2016-02-13 12:48:45.514736907 +0100 +++ /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/stream_change_cache.py 2016-02-15 12:55:55.840870403 +0100 @@ -32,7 +32,8 @@ entities that may have changed since that position. If position key is too old then the cache will simply return all given entities. """ - def __init__(self, name, current_stream_pos, max_size=10000, prefilled_cache={}): + def __init__(self, name, current_stream_pos, max_size=50, prefilled_cache={}): + max_size = 5 self._max_size = max_size self._entity_to_key = {} self._cache = sorteddict() Binary files synapse/util/caches/stream_change_cache.pyc and /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/stream_change_cache.pyc differ Binary files synapse/util/caches/treecache.pyc and /var/lib/lxc/synapse/rootfs/usr/local/lib/python2.7/dist-packages/synapse/util/caches/treecache.pyc differ