From e397ad57825ebbf9a11dc3653ae98d6654ac3722 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sun, 22 Mar 2015 19:16:29 -0500 Subject: [PATCH] cache.ram.max_ram_utilization = 90 --- gluon/cache.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gluon/cache.py b/gluon/cache.py index 7a984848..2f030297 100644 --- a/gluon/cache.py +++ b/gluon/cache.py @@ -96,6 +96,7 @@ class CacheAbstract(object): """ cache_stats_name = 'web2py_cache_statistics' + max_ram_utilization = 90 # percent def __init__(self, request=None): """Initializes the object @@ -248,7 +249,7 @@ class CacheInRam(CacheAbstract): self.storage[key] = (now, value) self.stats[self.app]['misses'] += 1 if HAVE_PSUTIL: - remove_oldest_entries(self.storage) + remove_oldest_entries(self.storage, percentage = self.max_ram_utilization) self.locker.release() return value