cache.ram.max_ram_utilization = 90

This commit is contained in:
mdipierro
2015-03-22 19:16:29 -05:00
parent ac78bf2f7d
commit e397ad5782
+2 -1
View File
@@ -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