diff --git a/gramps/gen/proxy/cache.py b/gramps/gen/proxy/cache.py index ed7845e29..3b207ddcb 100644 --- a/gramps/gen/proxy/cache.py +++ b/gramps/gen/proxy/cache.py @@ -57,7 +57,10 @@ class CacheProxyDb: if handle: del self.cache_handle[handle] else: - self.cache_handle = LRU(100000) + # Memory allocation is power of 2 where slots has to fit. + # LRU uses one extra slot in its work, so set max to 2^17-1 + # otherwise we are just wasting memory + self.cache_handle = LRU(131071) def get_person_from_handle(self, handle): """ @@ -104,15 +107,6 @@ class CacheProxyDb: self.cache_handle[handle] = self.db.get_place_from_handle(handle) return self.cache_handle[handle] - def get_place_from_handle(self, handle): - """ - Gets item from cache if it exists. Converts - handles to string, for uniformity. - """ - if handle not in self.cache_handle: - self.cache_handle[handle] = self.db.get_place_from_handle(handle) - return self.cache_handle[handle] - def get_citation_from_handle(self, handle): """ Gets item from cache if it exists. Converts